Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

PowerShell 3.0 - Description Field for Computer

$
0
0

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-Computer

My 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


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>