PSMSALNet 0.1.2 has been released

PSMSALNet 0.1.2 has been released

Hi All,

A few days ago, a new version of PSMSALNet has been released

-PowerShell Gallery PSMSALNet 0.1.2

I’ve checked the GitHub Changes and found that there has only be changed one Parameter

I am using the new PSResourceGet here instead of the PowerShellGet commands.

Show installed Versions and what’s available in PowerShell Gallery.

Get-InstalledPSResource -Name PSMSALNet -Scope CurrentUser
Find-PSResource -Name PSMSALNet

Uninstall the Module with PSResourceGet failed.

Uninstall-PSResource -Name PSMSALNet -Scope CurrentUser

You can use the -FileMode Parameter of M365PSProfile Module to uninstall the Module

Uninstall-M365Module -Module PSMSALNet -Scope CurrentUser -FileMode

Now let’s install the newest Version of the Module

Install-PSResource -Name PSMSALNet -Scope CurrentUser
Get-InstalledPSResource -Name PSMSALNet -Scope CurrentUser

Let’s list the Commands of the Module

Get-Command -Module PSMSALNet

Let’s make an Example with an App that has User.Read.All Permissions

###############################################################################
# Setting up Variables
###############################################################################
Import-Module PSMSALNet
$TenantId = "46bbad84-29f0-4e03-8d34-f6841a5071ad"
$AppID = "0d1c73de-c74d-4b06-8a35-e53c8e190258" # AADExport
$RedirectUri = "https://login.microsoftonline.com/common/oauth2/nativeclient"

###############################################################################
# Authenticate with Certificate
###############################################################################
$CertificateThumbprint = "A3A07A3C2C109303CCCB011B10141A020C8AFDA3" #O365Powershell3.cer
$Certificate = Get-ChildItem -Path cert:\CurrentUser\my\$CertificateThumbprint

$HashArguments = @{
  ClientId = $AppID
  ClientCertificate = $Certificate
  TenantId = $TenantId
  Resource = "GraphAPI"
}
$Token = Get-EntraToken -ClientCredentialFlowWithCertificate @HashArguments
$AccessToken = $Token.AccessToken
#$AccessToken
Get-JWTDetails -token $AccessToken

Let’s get an User

$Headers = @{"Authorization" = "Bearer "+ $AccessToken}
$URI = "https://graph.microsoft.com/v1.0/users/a.bohren@icewolf.ch"
$Result = Invoke-RestMethod -Method "GET" -Uri $uri -Headers $Headers
$Result

Or you can simply use my M365PSProfile Module - find the Documentation here: https://github.com/fabrisodotps1/M365PSProfile/

Uninstall-M365Module -Modules Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser -FileMode
Install-M365Module

Regards
Andres Bohren

vscode Logo

PowerShell Logo