Quantcast
Viewing all articles
Browse latest Browse all 3345

Re: PowerShell task to name computer from Service Tag during Provisioning

Very nice.... A additional tip

 

Add custom return codes to the distribution package. (Under "Assign return Codes")

 

Change your Write-Host commands to "Exit ###". ### being the number of the Custom Return code.

Then your results can be seen in the scheduled task!

 

 

Note:

You would have to change

    

 

          Write-Host "Renaming computer to $servicetag..."

          Rename-Computer -NewName $servicetag

   

to

 

 

          Rename-Computer -NewName $servicetag
          Exit ###


Viewing all articles
Browse latest Browse all 3345

Trending Articles



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