How to specify a custom class as the data type for a PowerShell script parameter?
In Powershell (specifically 5.1), I have a custom class Foo, defined in a file (Foo.ps1 or Foo.psm1) like this: Class Foo { .... } And in a script (.ps1 file) I want to use this type for one of the parameters, e.g.: Param( [Foo] $Bar ... I would like to…
AD RMS file bulk decryption using PowerShell
We’re in the process of trying to do a bulk decryption of Office files that were encrypted by AD RMS. We've identified a potentially effective PowerShell command, "Unprotect-RMSFile," that could address our decryption needs. We expected this…
How do I add tags in a name=value format to Service Principals to assist with automation?
I'm having trouble determining a clear answer on tagging Service Principals as the documentation seems to say you can't do it (https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-support) while several github and other resources…
Get Directory roles which assigned to users (Eligible or active both)
Hi, I am working on to collect details of directory roles which are assigned on user and get that details by powershell cli and mggraph api. I have "Get-MgUserTransitiveMemberOfAsDirectoryRole -UserId " but that is providing me only roles…
How can I get my SharePoint Online Management Module working in PowerShell?
(1) Trying to run any SPO command getting: Connect-SPOService : The term 'Connect-SPOService' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that…
How do we fix 0x8a15000f : Data required by the source is missing?
I Am trying to run winget on a widows 11 pc and keep getting the error 0x8a15000f : Data required by the source is missing. Have done update reset and still get the issue with the same error.
How to fix ClientCertificateCredential authentication failed:
I am getting this error on some Pipelines that I have inherited from a now departed colleague, I am unsure exactly how to fix this issue. Does anyone have any experience with this issue and a solution? ClientCertificateCredential authentication failed:…
Testing APIM API is giving null response when 200 ok
Hi Team, We have multiple APIs managed by APIM when test APIs by powershell it returns null response for 200 status code but we could see these there is some response for 401s. What could be the reason and how to fix it. Thanks venkatesh.k
New-AzApiManagementSubscription doesn't seems to work
Hi, I try to use in my Pwoershell script command : New-AzApiManagementSubscription to create a sunscription and add it to a Prodcut, but when I try it with different paramaters/syntax: CreateResult = New-AzApiManagementSubscription ` -Context…
How to schedule on Azure to run a powershell script on different VMs in specific hours.
Hi. I need to run a PowerShell script in different servers and different hours for each VMs. For exemple, Server A must run at 3pm, Server B must run at 5pm and Server C must run at 11am. I can run the PowerShell script successfully on "Run…
Discrepancy in Windows Form Appearance between PowerShell ISE and PowerShell
Hello Everyone, I've encountered an issue with the appearance of a Windows Form created using PowerShell. When running the script within PowerShell ISE, the form displays correctly with clear fonts and the expected size. However, when running the same…
SharePoint Online: Find Duplicate Documents using PowerShell
Could someone post a working script for getting a list of duplicate files in Sharepoint Online? The scripts formerly posted no longer work.
Why does Windows Powershell represent datetime values in 24h format when using string interpolation?
Edit: for clarity. Initial example was potentially confusing. Why does Windows Powershell output datetime values in 24h format when using string interpolation but follows my culture settings and outputs as 12h when referencing it explicitly? I'm…
Connect-PnPonline 404 Not Found Issue
I used connect-pnponline -url https://tenant.sharepoint.com/sites/contoso -Interactive -ClientId "XXX-XXXX-XXXXX-XXXXXX-XXXXX -Verbose It shows that I'm connected, but I get this error message. Get-PnPSite: The remote server returned an error: (404)…
Best Approach to Block Incoming Traffic During Initial Cache Loading in Azure VMSS
I am setting up a VMSS (Virtual Machine Scale Set) for a web application, and I need to perform an initial load of objects into the cache. To achieve this, I would like to open a web page on localhost to load the objects into the cache, but I don't want…
Assistance Needed with OneDrive and Office 365 Activity PowerShell Scripts
Dear All, I am using the scripts below to retrieve OneDrive and Office 365 activity details for my tenant. However, in the "User Principal Name" field, I am getting an ID instead of the email address. This issue started recently prior to that,…
How to get Get-TeamsProtectionPolicy function to use with Microsoft 365, since I'm getting an Exchange path error when trying to import the ExchangePowerShell module?
Hello all, I'm using PowerShell version 5.1.26100.2161 in case that's relevant. What I'm trying to do: I'm trying to use the PowerShell functions Get-TeamsProtectionPolicy and Get-TeamsProtectionPolicyRule to view a company's Teams protection policy…
App-only authentication for unattended scripts
Hi Team, We are developing an integration that will use the authentication (App-only authentication for unattended scripts) mechanism to integrate with Security & Compliance PowerShell. The article…
How to Install PIP for Python on Windows 11?
What are the steps to install PIP for Python on Windows 11? The goal is to use Python with Microsoft Excel and, if possible, replace VBA entirely.
How do get this command to return the results I need
First and foremost I am not a programmer, so scripting is hard for me. I have been tasked with creating dynamic distribution lists, while there is a GUI option in AAD it is not allowing for the granularity that we are seeking. We need the list to not…