minor rearranging

This commit is contained in:
2025-10-03 22:45:57 -05:00
parent 4af8ff2fa2
commit 080034b176
5 changed files with 85 additions and 73 deletions

View File

@@ -9,11 +9,11 @@ $CompName = $env:COMPUTERNAME
$ADCompOU = ([adsisearcher]"(&(objectClass=computer)(sAMAccountName=$CompName$))").FindOne().GetDirectoryEntry().distinguishedName
$PCNamePrefix = ($CompName.Substring(0,$CompName.IndexOf("-")))
$PCNameSuffix = ($CompName.Substring($CompName.IndexOf("-")+1))
# Domain Credentials to be used
. "\\berrypunch.technolog.net\PSCredentials$\Credentials-WKSDeploy.ps1"
Function RenamePCTNGPrefix {
Write-Host "Renaming this computer to TNG-$PCNameSuffix."
# Domain Credentials to be used
. "\\berrypunch.technolog.net\PSCredentials$\Credentials-WKSDeploy.ps1"
Rename-Computer -NewName "TNG-$PCNameSuffix" -DomainCredential $DomainCredential -Restart
}