I need to add a Network Service account to the Event Log Readers group which is part of Builtin groups on the Active Directory DC server using PowerShell script.
I am using the ActiveDirectory module but once I am running: $user = "NETWORK SERVICE" $group = "Event Log Readers" Add-LocalGroupMember -Group $group -Member $user -Verbose
I am receiving an error stating: Add-ADGroupMember: Cannot find an object with Identity: "NETWORK SERVICE" under: 'DC=xxx,DC=inc'
Note that I can go to the AD GUI and add this user under the group mentioned.
Your help is highly appreciated.
I am expecting to be able to add this user to the group using a PowerShell script
On Windows 2008 and later, the local Network Service runs under the AD Account of the computer and therefore you should only need to add the computer account
e.g. mydomain\mycomputername$