USB Drive Missing Space

I had formatted a usb flash drive to be a linux boot disk. Then, when finished, I went to reformat the drive and was only prompted to format 168MB out of the 1GB it originally had.

Open up the command line and type in the following:
disk part
list disk
select disk YOURDISKNUMBER
clean

After cleaning, you should be able to right-click and format again with the full amount of space. You can also finish this up using command line:
create partition primary
select partition 1
active
format fs=fat32 quick
assign
exit

Admin Share Windows 7 Server 2008

If the Windows 7 or Server 2008 (even R2) is not in a domain but in a workgroup, you may have administrative issues trying to access C$ etc.

Google found me this:
http://blog.hansmelis.be/2009/09/06/administrative-shares-in-windows-7/

A simple registry change and away you go. You do not have to reboot, but after the change you might have to wait up to a few minutes for it to work.

Those who have experience with NT-based operating systems on a network will certainly be familiar with the concept of administrative shares. If that doesn’t ring a bell, you access them like \\computername\c$. With this intro and the title of this post, you might be alarmed or enter panick mode fearing they might be gone in Microsoft’s latest OS iteration. Well don’t go into cardiac arrest because they are still there… but of course not without the odd problem.

Windows 7 still creates the administrative shares on install, but you can’t use them out of the box. First of all, you need to have File and Printer Sharing enabled. And the way to do that has once again been changed:

Open the control panel.
Go to Network and Internet.
Go to Network and Sharing Center.
In the left column, click on Change advanced sharing settings.
There are two profiles. You probably don’t want this on when you’re on a public network so open Home or Work.
Under the header File and Printer sharing, select the Turn on… option.

And now your administrative shares still don’t work 😛 You’ve just completed step 1 which implies there’s at least a step 2 and here it is: you also need to change the registry.

Click on the orb (= the round button with the Windows logo in the taskbar) and type regedit in the search box.
Open the registry editor.
Navigate all the way to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.
Right-click in the pane on the right side and add a new DWORD (32-bit).
Give the new setting the name LocalAccountTokenFilterPolicy.
Double click on that setting and give it a value of 1.

It’s probably wise to reboot after doing this, although it might not be needed. I’m not sure if it works straight away because I rebooted without trying.

Anyways, if you’re lucky you will be able to access administrative shares after performing these steps. If you’re unlucky, like me, doing all these things appears to have zero effect at all. Once again don’t panick, because there’s another hint/tip/solution coming your way.

Somewhere at some point during the installation or configuration of Windows 7, you will be asked to do something with a thing called Homegroup. It’s some weird new sharing tool that looks OK but isn’t quite what you’re used to. Once you have enabled that feature, you won’t be able to use the administrative shares. So the tip is: disable the homegroup feature.

Open the control panel.
Go to Network and Internet.
Go to HomeGroup.
Click on the blue link Leave the homegroup.

The popup dialog should point out itself, but I believe I picked to first option. Once I had left the homegroup, the administrative shares started working again.

I hope this post can help anyone who experiences the same problem.

Owncloud 4 and AD LDAP

I recently migrated from owncloud 3 to owncloud 4 for a few of the newest features (versioning, security, working ldap).

LDAP configuration
LDAP Basic
Host: IP or Resolvable DNS
Base: dc=DOMAIN,dc=TLD
Name: user@domain.tld
Password: password
User Login Filter: sAMAccountName=%uid
User List Filter: objectClass=user
Group Filter objectClass=group

Advanced
Port: 389
Case insensitive LDAP server checked
Display Name Field: sAMAccountName

Change Timezone Linux CLI

I had a security-onion box running and it defaults to UTC/GMT time.  This was fine for me as I could do the subtraction of time in my head, but for some in management they were questioning my findings due to the time being off.  So, to make my life easier, I decided to change the timezone.

The timezone under Linux is set by a symbolic link from /etc/localtime to a file in the /usr/share/zoneinfo directory that corresponds with what timezone you are in. For example, since I’m in Chicago, /etc/localtime is a symlink to /usr/share/zoneinfo/America/Chicago. To set this link, type:

ln -sf /usr/share/zoneinfo/your/zone /etc/localtime

http://www.linuxsa.org.au/tips/time.html

NPS Radius 2008 Cisco ASA VPN

I had IAS working on a 2003 server as a RADIUS server for authentication to a Cisco ASA for VPN connectivity.

1                     Create a RADIUS Client on the NPS

2                     Create a network Policy as follows;

  1. Right click network policies and click new
  2. Type a policy name accept the defaults and click next
  3. Add a condition (I used a windows group with my users in it), click next
  4. Make sure the access granted radio button is selected and hit next
  5. Select the “Unencrypted authentication (PAP, SPAP)” and unselect the rest
  6. Select NO on the annoying help box
  7. Finally select next then next and finish to complete.

3                     Configure your Cisco device for RADIUS as you would have with 2k3.

Migrate to new DHCP Server Microsoft

Export the DHCP database from Windows 2003:

1.                   On the Windows 2003 DHCP server, navigate to a command prompt

2.                   Type the following Command: netsh

3.                   Type the following Command: DHCP

4.                   Type the following Command: server <\\Name or IP Address>

5.                   Type the following Command: export c:\w2k3DHCPdb all

Note You must have local administrator permissions to export the data.

Import the DHCP database

1.       Copy the exported DHCP database file to the local hard disk of the Windows Server 2008-based computer.

2.       Install the DHCP Role on the server.

3.       Stop the DHCP server service on the server.  To do this, follow these steps:

a.       Log on to the target DHCP server by using an account that is a member of the local Administrators group.

b.      Click Start, click Run, type cmd in the Open box, and then click OK.

c.       At the command prompt, type net stop DHCPserver , and then press ENTER. You receive a “The Microsoft DHCP Server service is stopping. The Microsoft DHCP Server service was stopped successfully” message.

d.      Type exit, and then press ENTER.

4.       Delete the DHCP.mdb file under c:\windows\system32\DHCP folder.

5.       Start the DHCP server service.

6.       Right-click on the Command Prompt (cmd) and select run as administrator, to open the cmd prompt using elevated privileges.

Note You must have local administrator permissions to import the data.

7.       Type the following Command: netsh

8.       Type the following Command: DHCP

9.       Type the following Command: server <\\Name or IP Address>

10.   Type the following Command: import c:\w2k3DHCPdb

11.   Restart DHCP and verify the database has moved over properly.

Transfer FSMO Roles

Transfer the Schema Master Role

Use the Active Directory Schema Master snap-in to transfer the schema master role. Before you can use this snap-in, you must register the Schmmgmt.dll file.

Register Schmmgmt.dll

  1. Click Start, and then click Run.
  2. Type regsvr32 schmmgmt.dll in the Open box, and then click OK.
  3. Click OK when you receive the message that the operation succeeded.

Transfer the Schema Master Role

  1. Click Start, click Run, type mmc in the Open box, and then click OK.
  2. On the File, menu click Add/Remove Snap-in.
  3. Click Add.
  4. Click Active Directory Schema, click Add, click Close, and then click OK.
  5. In the console tree, right-click Active Directory Schema, and then click Change Domain Controller.
  6. Click Specify Name, type the name of the domain controller that will be the new role holder, and then click OK.
  7. In the console tree, right-click Active Directory Schema, and then click Operations Master.
  8. Click Change.
  9. Click OK to confirm that you want to transfer the role, and then click Close.

Transfer the Domain Naming Master Role

  1. Click Start, point to Administrative Tools, and then click Active Directory Domains and Trusts.
  2. Right-click Active Directory Domains and Trusts, and then click Connect to Domain Controller.

    NOTE: You must perform this step if you are not on the domain controller to which you want to transfer the role. You do not have to perform this step if you are already connected to the domain controller whose role you want to transfer.

  3. Do one of the following:
    • In the Enter the name of another domain controller box, type the name of the domain controller that will be the new role holder, and then click OK.

      -or-

    • In the Or, select an available domain controller list, click the domain controller that will be the new role holder, and then click OK.
  4. In the console tree, right-click Active Directory Domains and Trusts, and then click Operations Master.
  5. Click Change.
  6. Click OK to confirm that you want to transfer the role, and then click Close.

Transfer the RID Master, PDC Emulator, and Infrastructure Master Roles

  1. Click Start, point to Administrative Tools, and then click Active Directory Users and Computers.
  2. Right-click Active Directory Users and Computers, and then click Connect to Domain Controller.

    NOTE: You must perform this step if you are not on the domain controller to which you want to transfer the role. You do not have to perform this step if you are already connected to the domain controller whose role you want to transfer.

  3. Do one of the following:
    • In the Enter the name of another domain controller box, type the name of the domain controller that will be the new role holder, and then click OK.

      -or-

    • In the Or, select an available domain controller list, click the domain controller that will be the new role holder, and then click OK.
  4. In the console tree, right-click Active Directory Users and Computers, point to All Tasks, and then click Operations Master.
  5. Click the appropriate tab for the role that you want to transfer (RID, PDC, or Infrastructure), and then click Change.
  6. Click OK to confirm that you want to transfer the role, and then click Close.