5,598 questions with Windows Server PowerShell tags

Sort by: Updated
2 answers

WMI issues

The business where I work has several computers in our environment which have not getting cumulative updates in months and there are not items in the ccmcache folder. I wrote a very basic script to which checks if the WMI is "working" on a…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2025-01-09T00:29:23.8+00:00
MilesLindsay-4339 5 Reputation points
commented 2025-01-12T15:28:15.91+00:00
MotoX80 34,951 Reputation points
1 answer

Run Schedule Task that Connects to Graph

I need to create a Scheduled Task that will run a Powershell script that connects to Graph. What is the best way to setup the task so the creds are passed and it can log into Graph unattended. I have read some have created an App for this in Entra but I…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,753 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,809 questions
asked 2025-01-10T20:52:51.7866667+00:00
rr-4098 1,701 Reputation points
commented 2025-01-11T19:29:16.9766667+00:00
rr-4098 1,701 Reputation points
2 answers

Connect-PnPOnline: The sign-in name or password does not match one in the Microsoft account system.

Hello, I am trying to connect to SharePoint via Connect-PnPOnline. When I add my credentials for the SharePoint url in Windows Credential Manager and I type Connect-PnPOnline -Url https://<domain>.sharepoint.com everything works fine.…

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,184 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2022-06-24T08:56:59.607+00:00
Panos Konstantinidis 1 Reputation point
commented 2025-01-10T16:54:29.6+00:00
Random Dave 90 Reputation points
3 answers One of the answers was accepted by the question author.

Ms Graph - Disable User Account

Hi, I am writing a PowerShell script to disable Azure AD users that are not synced from on-premises. As part of the script I am running a foreach loop to disable the users with the following command: $params = @{ AccountEnabled = "false" …

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,753 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2022-07-06T10:16:51.793+00:00
Son 316 Reputation points
commented 2025-01-10T10:32:18.1633333+00:00
Son 80 Reputation points
3 answers

PoweShell Script to open specific app in secondary monitor

can anyone tell me what is the powershell script to open specific app in secondary monitor

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2021-12-03T12:50:29.887+00:00
Dharmesh Kulkarni 1 Reputation point
commented 2025-01-10T09:33:37.83+00:00
Stefan K 101 Reputation points
1 answer

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…

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,220 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,288 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,532 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,726 questions
asked 2024-12-27T22:19:26.7933333+00:00
Marcus Assis 0 Reputation points
answered 2025-01-10T03:46:23.3033333+00:00
Leo Visser 91 Reputation points MVP
0 answers

Powershell command Connect-IscsiTarget give an error when using CHAP authentication

Hi, I have an iSCSI Target located on a NAS. The IQN is "iqn.2004-04.com.qnap:ts-869pro:iscsi.datastore15qnap.dd1020". CHAP Authentication is set up. On a Windows machine I am able to connect to the LUN with the iSCSI Initiator GUI. However,…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2025-01-10T02:56:00.3533333+00:00
Georges Carraha 0 Reputation points
1 answer

Check if users are in Entra ID Recycle Bin

Hi Folks! I have a script which I am using today to check to see what users are in the Entra ID Recycle Bin and those who are no longer in the Recycle Bin. The script uses the Get-MsolUser -ReturnDeletedUsers command (which is being discontinued). It…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,809 questions
asked 2025-01-09T00:57:08.6433333+00:00
mark terry 85 Reputation points
commented 2025-01-09T21:21:26.2966667+00:00
mark terry 85 Reputation points
2 answers One of the answers was accepted by the question author.

[Active Directory] Export group members to CSV with their emails

Hello, I work in a larger globally managed company. I need to export a list of users from a particular group to a CSV file. I am using a simple command in PowerShell: "Get-AdGroupMember -identity "group-name" | select name |…

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,794 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2022-05-05T09:07:24.007+00:00
Jakub Grochowski 21 Reputation points
commented 2025-01-09T17:23:43.6666667+00:00
Gonzalez, Fred 0 Reputation points
1 answer

Get-MgUserCalendarView "The specified object was not found in the store"

I'm attempting to get info on some of our resource calendars. Since this doesn't function well within the EXO Powershell, I was pointed towards the MSGraph module. So I use these commands: $StartDate = "2024-01-01T19:00:00-08:00" >>…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,753 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2025-01-08T14:07:57.18+00:00
Jamro Chris 0 Reputation points
commented 2025-01-09T08:48:45.15+00:00
Jamro Chris 0 Reputation points
1 answer

The local farm is not accessible. cmdlets with featuredependencyid are not registered

Dears, Hope this mail finds you well. We are facing an issue with our SharePoint server while opening either the Windows PowerShell or SharePoint Management Shell, throwing an error as “The local farm is not accessible..”. I tried to run the Shell with…

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,404 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2024-12-11T08:30:11.6333333+00:00
Fahed Kollikavil 0 Reputation points
commented 2025-01-09T08:31:47.3333333+00:00
RaytheonXie_MSFT 37,546 Reputation points Microsoft Vendor
2 answers

inactive mailboxes

Hi All, I have a few inactive mailboxes under a retention policy in the Microsoft Purview Portal (Data Lifecycle Management → Retention policies → RP01). Let's say the policy is named RP01, and its GUID is u98k89mn-9876-ht68-mjki-kj78oophgy768. Exporting…

Microsoft Exchange Online
Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,329 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,683 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
2,192 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2024-12-26T16:40:30.9166667+00:00
Glenn Maxwell 12,001 Reputation points
commented 2025-01-09T01:19:35.2766667+00:00
Alex Zhang-MSFT 3,315 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

SharePoint Online: Find Duplicate Documents using PowerShell – File Hash Method 5000>

i am trying to get all duplicates files within 1 document library for lists larger than 5000 i am not able to merge the two scripts togther please refer to the script for getting items more than 5000…

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,039 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2021-11-07T12:40:36.53+00:00
Ayesh jamal 21 Reputation points
commented 2025-01-07T17:02:34.2433333+00:00
44785390 0 Reputation points
1 answer

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,…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,753 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,252 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,726 questions
asked 2024-11-25T08:33:02.72+00:00
Ameer 11 Reputation points
answered 2025-01-07T10:10:51.13+00:00
Rajat Vashistha-MSFT 90 Reputation points Microsoft Vendor
4 answers One of the answers was accepted by the question author.

WinGet.exe upgrade --all -Exclude

How to exclude the list of apps [third-party application, MS applications, and MS KBnumbers] while running winget upgrade -all commands. Is there any parameter to exclude any application? It will be appriciated

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,953 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,412 questions
asked 2023-04-07T17:32:54.1133333+00:00
Vij 306 Reputation points
commented 2025-01-06T16:42:57.45+00:00
Rich Matheisen 47,496 Reputation points
2 answers

Linux Distribution

Hi All, I want to install Ubuntu 22.04 LTS on Windows Server 2019. I am following the MS article linked below: https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions The article mentions performing the steps listed, but…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,869 questions
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,555 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,532 questions
Windows Server Infrastructure
Windows Server Infrastructure
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Infrastructure: A Microsoft solution area focused on providing organizations with a cloud solution that supports their real-world needs and meets evolving regulatory requirements.
560 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2025-01-02T17:39:19.91+00:00
Glenn Maxwell 12,001 Reputation points
answered 2025-01-06T04:25:28.45+00:00
Glenn Maxwell 12,001 Reputation points
1 answer

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…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,726 questions
asked 2025-01-03T15:34:09.4+00:00
cdsrm43 0 Reputation points
answered 2025-01-03T20:20:48.6033333+00:00
Rich Matheisen 47,496 Reputation points
1 answer

Printer Server Migration Remove Old Printer Mappings on Clients

I just finished migrating printers from an old windows server to a new 2022 server. The problem the environment is a mess and the printers were listed in Printer Server Manager as Deployed to both user and computers. Of course they were not deployed…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,953 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,794 questions
Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
697 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,409 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2024-12-30T18:45:57.2533333+00:00
rr-4098 1,701 Reputation points
commented 2025-01-03T11:29:50.57+00:00
rr-4098 1,701 Reputation points
3 answers

PowerShell File Watcher

Hello, I am looking for a solution how to, instead of waiting 15 seconds add code so my batch will run just after file is fully created (copied) - unlocked. Any help, please? SET FOLDER TO WATCH $watcher = New-Object…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
asked 2022-08-18T20:04:30.883+00:00
PF 11 Reputation points
answered 2025-01-02T21:40:20.98+00:00
Johannes Kingma 26 Reputation points
1 answer

Intune Custom Compliance Script issues

I am trying to setup a compliance policy to check that Crowdstrike is installed. I have tried running the script as the logged in user and not, etc.. same result. I know the script does not error out since I can run it on my workstation and it returns…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,598 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,412 questions
asked 2024-12-31T20:39:59.05+00:00
rr-4098 1,701 Reputation points
edited a comment 2025-01-02T02:38:07.61+00:00
ZhoumingDuan-MSFT 14,870 Reputation points Microsoft Vendor