CODE – PowerShell create a new computer object

How to create a new computer object on Active Directory without any plug-ins.

If you need to change the container you can do so:
“$objDomain = New-Object System.DirectoryServices.DirectoryEntry(“LDAP://OU=ASDF,DC=asdf,DC=asdf”)”
sAMAccountName requre a string $ at the end.

Works with:
Windows Server 2008 R2
Windows Server 2008
Windows Server 2003
Windows 7
Windows Vista
Windows XP



Leave a Reply