Wait for RPC Service before joining domain

This commit is contained in:
Adam Goldsmith 2022-09-16 01:09:50 -04:00
parent 99d31fa19c
commit c309393ebc
2 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,9 @@ If ($Null -eq $NewComputerName) {
$cred = New-Object System.Management.Automation.PsCredential("SAWTOOTH\Administrator", (ConvertTo-SecureString "REPLACE_WITH_PASSWORD" -AsPlainText -Force))
Write-Host "Waiting for RPC Service"
(Get-Service RpcSs).WaitForStatus("Running")
# rename computer and join to domain
Write-Host "Computer will be renamed to $NewComputerName."
Rename-Computer -NewName $NewComputerName -Force -Verbose

View File

@ -159,7 +159,7 @@
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>net use \\ucs.sawtooth.claremontmakerspace.org\software /user:SAWTOOTH\Administrator REPLACE_WITH_PASSWORD</CommandLine>
<CommandLine>net use \\ucs\software /user:DomainJoin REPLACE_WITH_PASSWORD</CommandLine>
<Description>Set Up UCS Share</Description>
<Order>1</Order>
</SynchronousCommand>