Jump to content


MattD

How to add workstation administrator group to task sequence

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.