Wondering if this can be done and if not, what are my options?
Scenario: Newly built Windows 7 PC
Goal1: Add PC to Domain and put in specific OU based on win32_computersystem.pcsystemtype
Goal2: Have a value entered that will show up in the Description field under General settings in Active Directory
I have Goal 1 done. Here is the code:
## DETERMINE IF DESKTOP OR LAPTOP
## AND THEN ADD TO DOMAIN USING SETUP ID
$Name = (Get-WmiObject win32_computersystem).Name
$Type = (Get-WmiObject win32_computersystem).pcsystemtype
$domain = "DOMAIN.NET"
$username = "$domain\setup"
$password = "XXX111" | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
switch -regex ($Type)
{
"1" {Add-Computer -DomainName $domain -Credential $credential -OUPath "OU=ComputersWB,DC=BLAIRNET,DC=NET"}"2" {Add-Computer -DomainName $domain -Credential $credential -OUPath "OU=ComputersUTIMACO,DC=BLAIRNET,DC=NET"}"3" {Add-Computer -DomainName $domain -Credential $credential -OUPath "OU=ComputersWB,DC=BLAIRNET,DC=NET"}
}
Restart-ComputerMy question is with Goal 2. Can this be done on the local PC without the Active Directory module installed? If not, what are my options as far as PSRemoting or something to run on a PC that i do not want ADUC installed.
Thanks.
Matt
Matt Dillon