5,600 questions with Windows Server PowerShell tags

Sort by: Updated
3 answers One of the answers was accepted by the question author.

How to get a list of shared links in a SharePoint Online document library? Any PowerShell or other way?

Hi there How to get a list of shared links in a SharePoint Online document library? Any PowerShell or other way? (Shared links when we click on the ellipsis next to a folder/file, and click Share, and type the emails of users) Thanks.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,057 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,600 questions
asked 2022-09-02T20:41:59.363+00:00
frob 4,241 Reputation points
commented 2025-01-14T19:53:32.9733333+00:00
Lonno 0 Reputation points
2 answers

How to extract used or free ips for all vnet with ip address space in powershell script

Extract used or free ips for all vnet with subnet and also giving the ip address space for bith vnet by using powershell. and also get the result for extracting output in CSV file.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,236 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,600 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,849 questions
asked 2023-03-27T11:19:14.5166667+00:00
Saranya M 0 Reputation points
commented 2025-01-14T16:29:34.4+00:00
Olia, Mehdi 0 Reputation points
1 answer

PowerShell Script to add users to Entra ID Security Group while not processing users already in the group - using MS Graph PowerShell

Hi folks! I have the following CSV File: userprincipalname user1@test.com user2@test.com I would like to able to use Microsoft Graph PowerShell to read the contents of this file so each member of the file is added to an Entra ID Security Group. I would…

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,600 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,849 questions
asked 2025-01-14T01:13:33.0633333+00:00
mark terry 85 Reputation points
commented 2025-01-14T15:54:16.61+00:00
mark terry 85 Reputation points
1 answer

Is there any function by which I can get details of Data disks attached to the VM like Disk Size,Space allocated/Remaining disk space ?

I am trying to get the details for Data Disk attached to the particular VM. The Main purpose is to get notified when the disk space is highly utilized. I can get the names of Data disks attached to the VM , but not getting the details like Disk…

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,315 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,236 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,600 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,735 questions
asked 2025-01-14T09:53:25+00:00
Tajman Kaur 0 Reputation points
answered 2025-01-14T10:27:47.8366667+00:00
Shikha Ghildiyal 2,170 Reputation points Microsoft Employee
3 answers One of the answers was accepted by the question author.

Error when running script for automated emails in Windows Server 2016

This is on Windows Server 2016. Running on PowerShell version 5.1.14393.4583. It was working before. No changes were made to the script or the server. Suddenly the script throws the following error message: Exception calling "Send" with…

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,600 questions
asked 2021-12-27T16:38:53.523+00:00
LRodz 21 Reputation points
commented 2025-01-13T17:27:42.89+00:00
JoeyMcJoeJoe 86 Reputation points
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,600 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 35,041 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,775 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,600 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,849 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,193 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,600 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,775 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,600 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,600 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,236 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,289 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,545 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,600 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,735 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 166 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,600 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,600 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,849 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,800 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,600 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,775 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,600 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,600 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,626 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,336 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,687 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,197 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,600 questions
asked 2024-12-26T16:40:30.9166667+00:00
Glenn Maxwell 12,011 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,057 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,600 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,775 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,258 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,600 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,735 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,960 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,600 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,422 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