I'm currently trying to query Entra ID properties if a user.
The commands go like this:Connect-MgGraph -Scopes User.ReadWrite.All
This appeared to work and showed the welcome message.Get-MgUser -Filter "userprincipleName eq '[email protected]'" | select -ExpandProperty EmployeeOrgData (real intuitive stuff).
This failed with the message:
Get-MgUser: The 'Get-MgUser' command was found in the module 'Microsoft.Graph.Users', but the module could not be loaded due to the following error: [Could not load file or assembly 'Microsoft.Graph.Authentication'... Assembly with same name already loaded.So I did some looking, ran
Get-Module, sure enough Authentication is loaded, tried running Remove-Module but that didn't help whatever, searched it up and apparently the best way to fix this is to just reinstall the module. OK ffs whatever.Uninstall-Module Microsoft.Graph.You cannot Uninstall blah blah blah. Administrator rights are required.OK, close powershell. Reopen as admin user.Run
Start-Process powershell -verb runas to elevate.Get new window, run Uninstall command again.Module not foundheavy exhausted sigh
Open a new powershell window, but version 7 this time,
pwsh instead of powershell.Run Uninstall module, completes fine.
Run Install-Module, completes fine.
Run GetMgUser,
Authentication needed. Please call Connect-MgGraph.Run Connect-MgGraph.
Long pause.
InteractiveBrowserCredential authentication failed:There is no further output after the :The window is now frozen, normally it would open a browser window for login, but it hasn't done that. I cannot close the window, I cannot minimize it, I cannot cancel the command. There is no hidden window on the desktop. I tried to close it with TaskMgr but it failed because it's an admin session.
I'm just so tired and exhausted of interacting with this absolute garbage system, it's all fucking shit, Microsoft produces nothing of any quality any substance it's just endless trash.
#Microsoft #powershell #azure #Entra #msgraph


