I'm still fairly new to the OSD task sequence portion for Imaging and Re-imaging in SCCM.
I need help with the Powershell cmdlets on how to call/carry over the OSDComputername variable from a previous Task Sequence step, which I believe contains the Computer name from reading the information in the BIOS, over to the Powershell environment so that I can run the following powershell commandline : remove-adgroup -identity "$computername-admin"
At my work, some of the workstations have security groups named after their computername appended with the “-admin” This is to keep track of members who require admin rights on otherwise locked down workstations. We often have workstations being rotated where a PC may be re-assigned to another employee and I would like to automate inside a task sequence during a re-image to just delete any existing “Computername-admin” security group in AD so that we can start fresh.
I hope my need for help makes sense. If not please ask and I’ll try my best to explain further.