What is the best way to execute PowerShell graph command executed against Azure / Entra ID ?
What is the best way to execute the PowerShell graph command executed against Azure / Entra ID ? $date = (Get-Date -Format "yyyy-MM-dd") 2Get-MgRiskDetection -All -Filter "ActivityDateTime ge $date and RiskLevel eq 'high'" The report…
Error Handling in ForEach-Object -Parallel CMDLET.
I Use a PowerShell 7 Script to Validate Resource Group and its JSON contents DisplayName, ObjectID and Role Definition Name. My Script will use Parallel block to loop through the subscriptions and validate RG First and then foreach Role Definition it has…
Connect-MgGraph : Invalid JWT access token. Connect-AzAccount : InteractiveBrowserCredential authentication failed
I need help and a solution to rectify the below error when executing the PowerShell Connect-* command. $TenantID = '22bb9241-65c8-45b4-94f9-7c151e154693' $AzSubscriptionID = 'd487514e-4317-447f-af79-5022d310f6bd' $paramConnectMgGraph = @{ Scopes =…
How to generate a report on a conditional access policy with Report Only mode ?
Hello Team, I'm looking for a free way even with a PowerShell script to get a report on a conditional access policy with Report Only mode. Thanks, Alaa Elrayes
How to browse and delete files under C:\System Volume Information\DFSR\Private directory ?
How to force delete the below file from my DFS replication staging area? C:\System Volume…
Installing GIT with out asking prompts with powershell
I am using below link and using windows 64 bit standalone installer. https://git-scm.com/download/win I can install this manually , but i want to install git in agent ( target machine) using powershell with out asking for any prompts , can we do that, if…
Task scheduler scripts
Hi All i have 100 plus scripts running on a VM. i have task schedulers running daily, for few weekly. i want to export all the task scheduler scripts to a csv file. using the below syntax i am able to export $data = @() foreach ( $task in…
Add exact upns
Hi All i have userprincipalnames in a csv file in the below format. usernames user1@contoso.com user2@contoso.com i want to add these users to AD group from powershell. if there are any other user with user1.a@contoso.com or user2.a@contoso.com. i…
Query a Specific service Value through Powershell
I Need help with the below PowerShell command to query the value of Windows Update "IsDefaultAUService" PS C:\Users\Administrator> $(New-Object -ComObject "Microsoft.Update.ServiceManager").Services Output of this command …
Exporting user last login to M365 or Azure to .CSV file ?
How can I extract and export the last user login time to the M365 portal or Azure AD as .CSV file? is there any PowerShell script or GUI procedure?
PS script deployed via GPO not installing
Hello experts, I could use some help determining why a PS script deployed via Group Policy is not applying. I suspect it is due to the ExecutionPolicy restriction however I have attempted to bypass in the script parameters as well as adding the bypass…
Update Micorosoft Store and Store Apps with command line?
Hi To update Microsoft Store and Store Apps, I navigate to the Store and select "Get Updates", like above screenshot. Question: Is there any possibility to achieve the same with Command Line /Power Shell or DISM?
GPO is not applying
Hi All i am applying the below GPO on an OU, this OU has Windows 2019/2016 Servers. My domain controllers are a mix of Windows 2019/2016. On the member server when i check RSOP i am seeing that the GPO is applied but when i check from gpedit.msc the gpo…
Powershell 5.1 not accepting keyboard input when using Remote Desktop HTML5 Web Client
Install the latest RDS HTML5 client on a RDS deployment as specified here: https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-web-client-admin Open a web browser session and start an RDS session. …
Powershell ISE Illegal characters in path with literalpath
Hello! I have encountered the problem of running PowerShell cmdlets using "LiteralPath" in PowerShell ISE, when folder is existing. Error message: Get-ChildItem : Illegal characters in path. At line:1 char:1 + Get-ChildItem -LiteralPath…
"Search-UnifiedAuditLog" will only return 100 items , any advice how we can expand this?
I have the following script which i tailored from this link https://www.easy365manager.com/office-365-forensics-using-powershell-and-search-unifiedauditlog/ to get the audit logs for 2 SharePoint sites Connect-ExchangeOnline $SiteIDs =…
Can I put the value of instanceDurationInDays in minutes for the QA while creating access reviews using powershell?
I am able to create an azure access reviews with Graph API 1.0 using PowerShell. Now, there is a property called instanceDurationInDays which should have an integer value. The access review will remain active for the number of days of the value of…
Rebuild server from core to desktop
I accidentally installed server core on an old PC i have and want to rebuild the server to Desktop, I have seen all the answers online and am aware that the only option is to rebuild the server. i have searched all over the internet on how to rebuild a…
EventID for the GPO
I have enabled the GPO (Turn on PowerShell Transcription): Computer Configuration-Administrative Templates-Windows Components-Windows PowerShell. Turn on PowerShell Transcription: Enabled. Should I see any other Event ID besides 4103 in Event Viewer with…
How to read contents of a CSV in Azure Blob storage using powershell
Hi, Is there any way to read the contents of a file in Azure blob using Powershell? I tried Get-AzStorageBlobContent but this stores the file in a local folder. I don't want to store the file locally. My requirment is to read the file from blob and…