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