Forum Discussion
Acesss Active Directoy from Linux
Should explain better what do you want to do?
Can you post the script?
Has the user the permission to logon locally ?
Bye Gas
What we ultimately want to do is to add a user to an AD-Group triggered from a Linux-Host. The Linux-Host has installed the latest Powershell. As far as we learned, the AD module is not available to be loaded on the Powershell in the Linux host.
So, we relied on 'new-pssession' and 'invoke-command' to a windows server. The invoke command calls a script on the windows server, supplying the correct arguments. The script itself does all the necessary actions to add the user to the desired AD group. It does this by first loading a stored credentials file and then calling the method with that credentials:
$cred=import-clixml -path $credentialFileName
...
Add-ADGroupMember -credential $cred -server $aServer -identity $aGroup -members $aUser
This works perfectly, as long as the user that we are using to run the script (the same user we use to open the new-pssession from the linux host) is logged in locally as the Windows server. If that user logs out, the credentials file cannot be imported anymore.
As an alternative, we tried to pass the credentials opening the session with -Authentication 'Credssp' instead of 'Negotiate', but that fails coming from a Linux host.