Jump to content


Daneo

How to add a PC to an AD group in OSD Task Sequence

Recommended Posts

Hi,

 

Can someone help me out with a problem I can't resolve? I'm not skilled enough to figure it out. :(

 

 

In our AD we have a separate security group for every school to deploy the printers to their computers.

 

 

During an SCCM 2012 OSD Task Sequence I want to show a list of the AD security groups. Then the local responsible person can choose the correct group to get the printers installed at their computers.

 

 

 

/Daneo

 

Share this post


Link to post
Share on other sites

Hey,

 

I do not know how to display AD Security groups but I knw hot set the membership during the task sequence.

You just have to create a SCCM Package which contain a powershell script :

 

function FindGn { param([string]$GroupName)
$Root = [ADSI]''
$Query = new-object System.DirectoryServices.DirectorySearcher($Root)
$Query.filter = "CN=$GroupName"
$Group = $Query.findall()
return $Group[0].path
}
foreach ($Group in $Args) {
$SysInfo = New-Object -ComObject "ADSystemInfo"
$HostN = $SysInfo.GetType().InvokeMember("ComputerName", "GetProperty", $Null, $SysInfo, $Null)
$GroupN = FindGN $Group
$GroupN = [ADSI]$GroupN
$GroupN.Add("LDAP://$HostN")
}
If the script is called SetMembership The command line Task in you TS must be : Powershell -ExecutionPolicy Bypass -File SetMembership.ps1 "Group 1" " Group 2 " "..."
I hope it could help you

 

Bye

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.