Advertisement
Guest User

Untitled

a guest
Jan 7th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. $domain = "dominio.fmu.br"
  2. $hostname = Read-Host "Digite o Hostname"
  3. $description = ($hostname -split "-")[1]
  4. $username = "$domain\renan.sanches"
  5. $password = cat securestring.txt | ConvertTo-SecureString -Force
  6. $credential = New-Object System.Management.Automation.PSCredential($username,$password)
  7. Get-CimInstance -ClassName Win32_OperatingSystem | Set-CimInstance -Property @{Description = $description }
  8. Add-Computer -NewName $hostname -DomainName $domain -Credential $credential -Restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement