Skip to content

How to add workstation administrator group to task sequence

Featured Replies

Hi all,

 

First time poster, and only a couple months into attempting to learn SCCM. I searched around for this issue, but all I found was related to adding single users to a local admin group...

 

OK,

 

Ive been able to create a basic working task sequence for OSD, and so far its going OK. However, I learned today that one of our remote locations was unable to make changes to his machine. I found that when he logged in, that my user was missing the workstation admin group from our domain.

 

So my question: Is there some generic command line script I can try to use that will auto- populate the appropriate workstation group needed at the desired location(either defined by username or subnet perhaps). Since we have multiple locations all over, I cant set it as a fixed deal.

 

The user would be imaging the machine via USB using offline media creation, and IS connected to our network to allow the machine to join the domain while the task sequence is running.

I hope I made sense above! As said, Im very new to this, and have gotten most my learning in SCCM from here and just figuring it out. Please forgive me if my terminology is wrong.

 

 

Thanks

Do you want to add the workstation to an AD-group during OSD so that admin have access? If so, this PS-script may help you out.

 

$ComputerName = gc env:computername

$GroupPath = "LDAP://CN=ADM_SCCM_Workstations,OU=Groups,OU=System,OU=GMSC,DC=internal,DC=gustomsc,DC=com"

$computerPath = "LDAP://CN=$ComputerName,OU=Desktops,OU=Workstations,OU=GMSC,DC=internal,DC=gustomsc,DC=com"

$Group =[ADSI]"$GroupPath"

$Group.Add("$computerPath")

$Group.SetInfo()

 

Save the script as a PS1 file. Make sure you put it in your TS after you have network connection and the machine has been added to the domain. Mine runs from a share. Run it with the following command-line: powershell.exe -executionPolicy Bypass -file .\desktops.ps1

If this is not the Script you are looking for, perhaps this may help: http://blogs.technet.com/b/heyscriptingguy/archive/2014/10/03/adding-local-users-to-local-groups.aspx

Sounds like you have multiple locations that each have their own workstation admin group. We have the same situation. Honestly, your best bet is to use Group Policy. We ended up creating a GPO for each location's workstation OU. If you really wanted to, you can probably use the above script as a base but you would have to create some kind of logic that matches IP/subnet to the group and then adds the group.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.