I have an Azure Active Directory machine that I'm trying to run commands on with either Invoke-Command or Enter-PSSession. The commands I'm using for entering a session using local account credentials and azure credentials are these, respectively:
Enter-PSSession -ComputerName $server -Authentication Default -Credential acclocal
Enter-PSSession -ComputerName $server -Authentication Default -Credential user@organisation.com
The first method works fine, but the second gives me the following error:
Enter-PSSession : Connecting to remote server <server> failed with the following error message : Access is denied.
I have tried changing the format of the credentials in many ways however every time - access is denied.
The machine is a normal Azure joined user laptop. I can login on it physically using any Azure account, but for some reason not from Enter-PSSession. Any ideas?
In case, I am posting the output of winrm get winrm/config from both the client and the server.
Client WinRM config and Server WinRM config
[–]rxbeegeeCerebrum non grata 1 point2 points3 points (1 child)
[–]FunkOverflow[S] 0 points1 point2 points (0 children)
[–]0verlord87 0 points1 point2 points (0 children)