shanetemple90
shanetemple90

Reputation: 17

Add Authenticated Users to Administrators Group via Powershell

I'm currently developing a PS script that will compile all the tasks of creating a fully configured W10 image. Part of my job involves image creation and maintenance and currently each image from scratch takes a couple hours or more to fully configure. That's without distractions.

We have images for 5 separate generations of HP OEM machines as well as touchscreen and waiting room screens (Healthcare Waiting Rooms) and I like to create separate images after every feature update so that there each image is as fresh as possible. You can probably imagine the amount of time this takes.

With a PS script to create these with small amounts of user interaction, this would provide ultimate consistency across the board and considering these images go out to thousands of machines, this is very important for me.

My Problem:

I'm currently trying to apply the 'Authenticated Users' security group to the 'Administrators' local group. The problem I've found is that powershell does not see 'Authenticated Users' as a security group, I imagine it actually see's it as a security prinicipal.

It's very easy to Add this principal to the 'Administrators' group via the GUI via LUSRMGR.MSC however I have been unsuccessful in letting PS control this.

I've tried the Add-LocalGroupMember -Member 'Administrators' -Group 'Authenticated Users' but this does not work.

Is there a way to add a security principle to a security group?

It's easy enough to do this via the GUI at the start or end of the image creation process but it would be nice to have PS handle everything I need it to.

Any suggestions to anywhere that may be able to clarify this process or has anyone got any ideas?

Thanks in advance

Upvotes: 0

Views: 3225

Answers (1)

LosFla
LosFla

Reputation: 119

try to add the well known security group "Authenticated Users" via SID: 'S-1-5-11' to the local Administrator Group.

Add-LocalGroupMember -Group "Administrators" -Member 'S-1-5-11'

S-1-5-11: Authenticated Users


https://support.microsoft.com/en-au/help/243330/well-known-security-identifiers-in-windows-operating-systems

Upvotes: 2

Related Questions