Power shell script error "Set-ADServerSettings -ViewEntireForest $True"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
Hi
I'm doing a Active directory sync via MID server and I have power shell script written it is working for users to certain group below is the script
import-module "$executingScriptDirectory\ADSpoke\ActiveDirectoryMain"
if (test-path env:\SNC_groupname) {
$groupname = $env:SNC_groupname;
$username = $env:SNC_username;
};
$groupname = $groupname -replace "%27","'";
$username = $username -replace "%27","'";
SNCLog-ParameterInfo @("Running AddUserToADGroup", $groupname, $username)
addADUserAccountToGroup -domainController $computer -username $username -groupname $groupname -useCred $useCred -credential $cred
But I wasn't to enable for all the users so added this line of code 'Set-ADServerSettings -ViewEntireForest $True'
This throwing error at cmdlet
here is the error:
The term 'Set-ADServerSettings' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
HRESULT: [-2146233087]
