Forum Widgets
Latest Discussions
Removing extranious data from a string @{Name=WEBHOST001-OI3w}
how would I convert @{Name=WEBHOST001-OI3w} to WEBHOST001-OI3wrmerrittJan 14, 2026Copper Contributor127Views0likes3CommentsBuild PowerShell as "framework-dependent"
Before I start a time expensive and maybe unsuccessful attempt: Is it relatively easily possible to compile PowerShell from the source and make it "framework-dependent" instead of "self-contained"? In doing so, PowerShell could be de-coupled from the .NET runtime (which is most probably already installed), and maybe an even newer runtime version could be used (currently, PowerShell has no .NET 10 packed and I have to wait for a release that supports it)...ahinterlJan 14, 2026Brass Contributor19Views0likes1CommentSet-ADAccountPassword CmdLet not found
Hi, Edition: Windows Server 2022 Standard Version: 21H2 PowerShell with "administrator" rights I installed successful: Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools* Install-WindowsFeature -Name RSAT-ADDS-Tools If I try to call Set-ADAccountPassword -Identity MyUserName The CmdLet is not found I didn't found infos on https://learn.microsoft.com/en-us/powershell/module/activedirectory/set-adaccountpassword?view=windowsserver2025-ps What is missing?SolvedFrank__37Jan 09, 2026Copper Contributor46Views0likes1CommentExchange Management Shell fails to load after Exchange SE update KB5071876
Hello, After installing Exchange Server Subscription Edition update KB5071876, Exchange Management Shell no longer loads correctly and generates PowerShell related errors. The server is currently in maintenance mode. I tested uninstalling and reinstalling the update, but the issue persists. I verified the applied Group Policies and did not find any GPO explicitly blocking PowerShell script execution. I have attached screenshots of the error messages, the applied GPO settings, and the PowerShell execution policy output. PowerShell execution policy result: MachinePolicy Undefined, UserPolicy Undefined, Process Undefined, CurrentUser Undefined, LocalMachine RemoteSigned. Despite this configuration, Exchange PowerShell scripts such as RemoteExchange.ps1, CommonConnectFunctions.ps1 and ps1xml files are still blocked and Exchange cmdlets are not available. Any guidance or similar experience after installing this update would be greatly appreciated. Thank you in advance.SolvedabenyahiaJan 08, 2026Copper Contributor91Views0likes4CommentsError trying to Connect-PnPOnline
Hi! I'm using PowerShell in VSC to run the following script: # Install PnP PowerShell module if not already installed # Install-Module PnP.PowerShell -Force # Define SharePoint site URL, folder path, and the sensitivity label to apply $SiteUrl = "https://yourtenant.sharepoint.com/sites/yoursite" $FolderPath = "Shared Documents/YourFolder" # Example: "Documents/ConfidentialData" $SensitivityLabelId = "YourSensitivityLabelId" # The GUID of your sensitivity label # Connect to SharePoint Online Connect-PnPOnline -Url $SiteUrl -UseWebLogin # This will open a browser for authentication # Get all files in the specified folder $Files = Get-PnPListItem -List "Documents" -Folder $FolderPath | Where-Object { $_.FileSystemObjectType -eq "File" } # Loop through each file and apply the sensitivity label foreach ($File in $Files) { Write-Host "Applying label to: $($File.FieldValues.FileRef)" Set-PnPSensitivityLabel -ListItem $File -SensitivityLabelId $SensitivityLabelId } Write-Host "Sensitivity label application complete." I keep getting this error, "OperationStopped: Unable to load DLL 'msalruntime' or one of its dependencies: The specified module could not be found. (0x8007007E) See https://aka.ms/msal-net-wam#troubleshooting" I'm using: ExchangeOnlineManagement version 3.9.0 PnP.Powershell version 3.1.0 VSC version 1.107 PowerShell version 7.5.3.0 I've tried changing Connect-PnpOnline from "UseWebLogin" to "Interactive" (that asks for an Entra ID App Reg and says it's not supported). Any idea where this going wrong?kcelmerDec 22, 2025Brass Contributor111Views0likes2CommentsSet-PnpSensitivityLabel cmdlet not found after installing module
Hi All! I've been working on a script to set sensitivity labels for all files in a SharePoint folder. I'm using the cmdlet "Set-PnPSensitivityLabel" but it isn't found. I've uninstalled pnp.powershell. I've reinstalled it. I've updated it. I've imported it. (Repeated these steps twice) The cmdlet is still not found. I've listed all the cmdlets in the module and it is not being installed. Any suggestions would be appreciated.kcelmerDec 16, 2025Brass Contributor24Views0likes0CommentsGet-PnPListItem retrieving no files from SharePoint folder with files
Hello! Can anyone assist with this script? I'm fairly new to PowerShell and it's likely something simple I don't know, yet. # Install PnP PowerShell module if not already installed # Install-Module PnP.PowerShell -Force # Define SharePoint site URL, folder path, and the sensitivity label to apply $SiteUrl = "https://XXXXXXXXXX.sharepoint.com/" $FolderPath = "/sites/IT/Shared%20Documents/General/Azure%20SSO" # Example: "/Documents/ConfidentialData" $SensitivityLabelId = "7e01211f-294a-4f47-9efd-aebe45f12d17" # The GUID of your sensitivity label # Connect to SharePoint Online Connect-PnPOnline -Url $SiteUrl -ClientID "XXXXXXXXXXXXXXXXXXXXX" # This will open a browser for authentication # Get all files in the specified folder Write-Host "Getting Files..." $Files = Get-PnPListItem -List "Documents" -FolderServerRelativeUrl $FolderPath | Where-Object { $_.FileSystemObjectType -eq "File" } Write-Host "Files found $Files" # Loop through each file and apply the sensitivity label foreach ($File in $Files) { Write-Host "Applying label to: $($File.FieldValues.FileRef)" Set-PnPSensitivityLabel -ListItem $File -SensitivityLabelId $SensitivityLabelId } Write-Host "Sensitivity label application complete." The line $Files = Get-PnPListItem -List "Documents" -FolderServerRelativeUrl $FolderPath | Where-Object { $_.FileSystemObjectType -eq "File" } retrieves no files so it just skips the following loop and ends with no errors. I added the line Write-Host "Files found $Files" to verify that it was not finding anything.kcelmerDec 16, 2025Brass Contributor68Views0likes1Comment- DeepakMhaskarDec 13, 2025Copper Contributor28KViews0likes3Comments
Resources
Tags
- Windows PowerShell1,199 Topics
- powershell346 Topics
- office 365280 Topics
- azure active directory145 Topics
- sharepoint132 Topics
- windows server130 Topics
- azure99 Topics
- exchange98 Topics
- community55 Topics
- azure automation50 Topics