Rename all Domain Local Administrator Username Via Script

Posted on March 20th, 2009 in Active Directory, Microsoft, Scripts, Server 2008, Vista by Gil Kreslavsky

Use this PowerShell script to rename Local Administrator Account on a list of remote machines.

#$erroractionpreference = “SilentlyContinue”
$a = New-Object -comobject Excel.Application
$a.visible = $True
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$c.Cells.Item(1,1) = “Machine Name”
$c.Cells.Item(1,2) = “Account Renamed”
$c.Cells.Item(1,3) = “Report Time Stamp”
$d = $c.UsedRange
$d.Interior.ColorIndex = 19
$d.Font.ColorIndex = 11
$d.Font.Bold = $True
$intRow = 2
foreach ($strComputer in get-content C:\MachineList.Txt)
{
$c.Cells.Item($intRow,1) = $strComputer.ToUpper()
# Using .NET method to ping test the servers
$ping = new-object System.Net.NetworkInformation.Ping
$Reply = $ping.send($strComputer)
if($Reply.status -eq “success”)
{
$admin=[adsi](“WinNT://” + $strComputer + “/administrator, user”)
#This is the one line change
$admin.psbase.rename(“whatever”)
$pwage = $admin.passwordage
If($pwage -ne $null)
{
$c.Cells.Item($intRow,2).Interior.ColorIndex = 4
$c.Cells.Item($intRow,2) = “Yes”
}
Else
{
$c.Cells.Item($intRow,2).Interior.ColorIndex = 3
$c.Cells.Item($intRow,2) = “No”
}
}
Else
{
$c.Cells.Item($intRow,2).Interior.ColorIndex = 3
$c.Cells.Item($intRow,2) = “Not Pingable”
}
$c.Cells.Item($intRow,3) = Get-Date
$Reply = “”
$pwage = “”
$intRow = $intRow + 1
}
$d.EntireColumn.AutoFit()
cls

Source:http://myitforum.com/cs2/blogs/yli628/

Unable to migrate from vmhost to vmhost2: Host CPU is incompatible with the virtual machine’s requirements at CPUID level error

Posted on November 6th, 2008 in ESX Server, VMware by Gil Kreslavsky

You may see that error when you migrate virtual machine between two ESX servers with different hardware.

Please right click on VM and choose “Edit Options”, select “Options”, select “CPUID mask” and change it to “Hide the NX flag from quest”.

CPUID

CPUID

It will give you more comparability between CPUs but will hurt performance.

Restoring Active Directory Object from backup

Posted on August 20th, 2008 in Active Directory, Microsoft by Gil Kreslavsky

Due to the risk involved, The procedure must be done very carefully. It is good first to do some training on non operational domain .

To restore Active Directory DB from backup:

  • Determine exactly the object name that needs to be restored (OU name).
  • Reboot domain controller into authoritative restore mode.
  • Restore the system state from last backup.
  • Open a command window
  • Run “ntdsutil”
  • Type “authoritative restore”, press Enter
  • To restore a subtree, type “restore subtree” and the entire object name of the subtree to be restored. For example, to restore the sub-OU “Test ou2″ located in the upper-level OU “Marketing”, use the following syntax, being careful to capitalize as necessary: Example “restore subtree OU= Test ou2,OU= Marketing,DC= your sub domain name ,DC=your domain name ,DC=com”
  • Type “quit” to exit from authoritative restore mode
  • Type “quit” to exit from ntdsutil
  • Reboot into normal operating mode

Replicating Restored data to other Domain Controllers

So basically what we did , we loaded the appropriate subtree into the replication system.
and no we need to Replicate the AD as follows:

  1. Open the AD Sites & Services MMC
  2. Open a DC that is not the one that was just used to restore Active Directory Data
  3. Open NTDS Settings
  4. Right-click each of the other servers and click “Replicate Now”

Good luck

And remember if you have any way to avoid this procedure , please use the other way

Related Blogs

Blackberry Calendar Sync Works One Direction only

Posted on August 12th, 2008 in BES Server, Black Berry, BlackBerry Device by Gil Kreslavsky

BlackBerry Enterprise Server administration account must have the following permissions (Send As, Receive As, and Administer Information store) at the server level:

1. Go to Microsoft Exchange System Manager.

2. Expand Administrative Groups.

3. Right-click on the Exchange Server(s) that will be hosting the BlackBerry users’ mailboxes.

4. Click Properties.

5. Click the Security tab.

6. Click Add.

7. Select the BlackBerry Enterprise Server administration account.

8. In the Permissions window, mark with “v” Send As, Receive As, and Administer Information store permissions are granted.

Grant Send As, Receive As, and Administer Information store permissions at the mailbox tore level:

1. Select the mailbox store(s) for the Exchange Server(s) that will be hosting BlackBerry users’ mailboxes.

2. Click Properties.

3. Click the Security tab.

4. Select the Allow inheritable permissions from parent to propagate to the object option.

5. In the Permissions window, verify that Send As, Receive As, and Administer Information store permissions are granted.

Grant Send As, Receive As, and Administer Information store permissions at the public folder store level:

1. Open the Microsoft Exchange System Manager that is installed on the server(s) where the BlackBerry users’ public folder store resides.

2. Expand Administrative Groups.

3. Expand Servers and storage groups.

4. Right-click on the public folder store that will be hosting the BlackBerry users’ folders.

5. Click Properties.

6. Click the Security tab.

7. Click Add.

8. Select the BlackBerry Enterprise Server administration account.

9. In the Permissions window, verify that Send As, Receive As, and Administer Information store permissions are granted.

Vmware Infrastructure Vmoution Video

Posted on July 29th, 2008 in ESX Server, VMware, Videos by Gil Kreslavsky

Demonstration of Vmotion on Dell PowerEdge Blade Servers