5,423 questions with Windows Server PowerShell tags

Sort by: Updated
2 answers

Powershell backup and then send email. send email has issues

<# Script: Backup database with email notification Version 1.3 - May. 31, 2024 This script performs full and transaction log backups of the Mobile database and sends email notifications. #> Variables $serverName = "TFS" $databaseName =…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,971 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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-06-04T07:34:32.9666667+00:00
Dyan Marquez 0 Reputation points
answered 2024-06-04T23:37:48.7833333+00:00
Plamen Peev 80 Reputation points
1 answer

Could not find any service with display name ‘XCELERAINST ’

Hi Experts, I was trying to install MSSQL 2019 via powershell. During the MSSQL installation we are setting instance service name as XCELERAINST. As per our code we trying to check the service XCELERAINST. If the XCELERAINST service already present then…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,971 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,355 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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-06-04T14:06:43.2333333+00:00
Jimmy Afflick 40 Reputation points
commented 2024-06-04T22:02:48.3666667+00:00
Jimmy Afflick 40 Reputation points
3 answers One of the answers was accepted by the question author.

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…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,525 questions
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,408 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,355 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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-05-28T15:51:47.9+00:00
Glenn Maxwell 10,471 Reputation points
accepted 2024-06-04T21:52:09.2966667+00:00
Glenn Maxwell 10,471 Reputation points
3 answers

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…

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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-05-30T09:39:05.6366667+00:00
Ramakrishna Abhijeet P 70 Reputation points
answered 2024-06-04T21:29:53.88+00:00
Rich Matheisen 45,261 Reputation points
0 answers

Ways on how to manage azure Devices and Find device location per office

Hi, Im on creating some automation to delete all stale devices in Entra ID (not in intune) and i need to find a way to find each device location so i can separate them every office. are there any ways to check the device location or physcial location? im…

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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,957 questions
asked 2024-06-04T13:06:28.0866667+00:00
Darren Ramos 0 Reputation points
0 answers

Ways on how to manage azure Devices and Find device location per office

Hi, Im on creating some automation to delete all stale devices in Entra ID (not in intune) and i need to find a way to find each device location so i can separate them every office. are there any ways to check the device location or physcial location? im…

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,423 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,957 questions
asked 2024-06-04T13:04:03.4933333+00:00
Darren Ramos 0 Reputation points
0 answers

Need to configure Report to check daily backup, patch and Reboot status for azure virtual machine using Powershell script

Need to configure Report to check daily backup, patch and Reboot status for azure virtual using Powershell script

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,150 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,423 questions
asked 2024-05-10T17:57:15.4233333+00:00
Himanshu Garg 0 Reputation points
edited the question 2024-06-04T11:04:01.74+00:00
vipullag-MSFT 25,126 Reputation points
1 answer

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…

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,355 questions
Windows Server Security
Windows Server Security
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
1,755 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.
523 questions
Windows Server Storage
Windows Server Storage
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Storage: The hardware and software system used to retain data for subsequent retrieval.
639 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,423 questions
asked 2024-06-03T06:59:43.13+00:00
EnterpriseArchitect 4,896 Reputation points
commented 2024-06-04T04:41:16.7166667+00:00
EnterpriseArchitect 4,896 Reputation points
3 answers

Connect-Exchange Online (Error while sending the request)

Hello, I'm getting the below Error while connecting to Exchange Online (PowerShell Script) when called from .Net Application. #Import-Module ExchangeOnlineManagement #Connect-ExchangeOnline -Credential $Creds An error occurred while…

Microsoft Exchange Online
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
521 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.
1,934 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,423 questions
asked 2023-11-20T10:17:36.3+00:00
AW13-2828 10 Reputation points
commented 2024-06-03T20:46:23.7233333+00:00
DB 0 Reputation points
3 answers One of the answers was accepted by the question author.

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?

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,423 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,957 questions
asked 2022-10-10T13:43:24.61+00:00
EnterpriseArchitect 4,896 Reputation points
commented 2024-06-03T19:03:57.9266667+00:00
BenJackson 0 Reputation points
1 answer

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…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,943 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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,957 questions
asked 2024-05-27T14:14:48.94+00:00
EnterpriseArchitect 4,896 Reputation points
edited a comment 2024-06-03T12:53:32.55+00:00
Sina Salam 4,811 Reputation points
1 answer

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

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,943 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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-05-28T07:17:43.8466667+00:00
EnterpriseArchitect 4,896 Reputation points
edited the question 2024-06-03T12:23:35.3733333+00:00
Givary-MSFT 28,766 Reputation points Microsoft Employee
1 answer

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

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,423 questions
Microsoft Intune Reporting
Microsoft Intune Reporting
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Reporting: The process of giving an account of something that has been observed, heard, done, or investigated.
63 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,524 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-05-28T08:18:26.5433333+00:00
A.Elrayes 186 Reputation points
edited the question 2024-06-03T12:23:14.1233333+00:00
Givary-MSFT 28,766 Reputation points Microsoft Employee
1 answer One of the answers was accepted by the question author.

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…

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,321 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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-05-31T09:42:13.34+00:00
Varma 1,250 Reputation points
accepted 2024-06-02T13:59:44.46+00:00
Varma 1,250 Reputation points
1 answer One of the answers was accepted by the question author.

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…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,525 questions
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,408 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,355 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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-04-07T23:46:54.6566667+00:00
Glenn Maxwell 10,471 Reputation points
accepted 2024-06-02T05:42:34.2+00:00
Glenn Maxwell 10,471 Reputation points
2 answers One of the answers was accepted by the question author.

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…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,525 questions
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,408 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,025 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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-04-30T18:33:23.3266667+00:00
Glenn Maxwell 10,471 Reputation points
accepted 2024-06-02T05:42:08.3666667+00:00
Glenn Maxwell 10,471 Reputation points
2 answers One of the answers was accepted by the question author.

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 …

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,423 questions
asked 2022-08-26T04:00:48.447+00:00
Hari Bylapudi 21 Reputation points
answered 2024-06-01T11:28:34.97+00:00
Christian Eriksson private 0 Reputation points
0 answers

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…

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,423 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,197 questions
asked 2024-05-31T15:56:09.6733333+00:00
Eric Ma 0 Reputation points
3 answers

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?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,876 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,512 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,423 questions
asked 2022-09-05T09:31:41.387+00:00
~OSD~ 2,131 Reputation points
commented 2024-05-31T14:57:22.4+00:00
Vincent Duvernet 1 Reputation point
1 answer One of the answers was accepted by the question author.

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…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,525 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,355 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,025 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,423 questions
asked 2024-05-27T17:38:21.0133333+00:00
Roger Roger 5,006 Reputation points
accepted 2024-05-31T12:44:41.57+00:00
Roger Roger 5,006 Reputation points