Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

SOLVED Applications with OU Requirements not installing during Task Sequence

  • Thread starter Thread starter m0rph
  • Start date Start date
  • Replies Replies 2
  • Views Views 4K
Status
Not open for further replies.

m0rph

Member
Messages
18
Reaction score
2
Points
3
Hi,

Just wanted to share this here, as this site helped me a lot in finding solutions for all kinds of SCCM problems.

Recently, I reduced the number of applications in our environment, by merging several applications in 1 application with different deployment types. For some of them, I had set a "requirement" for membership of an Organizational Unit (OU). These applications failed to install as group policy is disabled when the task sequence is running, and the needed registry keys/values are not present yet.

I got around this problem by creating the keys and Distinguished-Name value manually, and populating is with ADSI. This avoids the need of installing the powershell AD module.

Just add a "powershell script" step in your task sequence, after OS installation and before you install applications and enter following script. No need to change anything for you environment. The script:

New-Item -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy' -Name State -Force
New-Item -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State' -Name Machine -Force
$Object = "(&(objectCategory=computer)(objectClass=computer)(cn=$env:COMPUTERNAME))"
$dn = ([adsisearcher]$object).FindOne().Properties.distinguishedname
New-Itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine' -Name 'Distinguished-Name' –PropertyType String -value $dn

Enjoy!
 
Status
Not open for further replies.

Forum statistics

Threads
7,181
Messages
28,010
Members
18,315
Latest member
WillR

Trending content

Back
Top