Microsoft Q&A

Windows Server PowerShell

5,084 questions

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.

Browse all Windows tags

5,084 questions with Windows Server PowerShell tags

Sort by: Updated
0 answers

How to remove bitlocker encryption from secondary hard drive.

Hi, I want to remove the BitLocker encryption from my D: drive as it is annoying and unnecessary. I tried using the powershell and the deactivate command but it is giving me an Access Denied error. Please advise how I can remove 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,084 questions
asked 2023-09-21T09:29:23.7466667+00:00
Ethan England 0 Reputation points
2 answers

Microsoft Graph scheduled task script while signed out doesn't work

Whenever I run the script manually in the task scheduler it works fine and able to output the logfile but when I run it as a scheduled task with setting "Whether user is logged on or not" it doesn't add a log file. it seems like it's not even…

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
10,539 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,084 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,288 questions
asked 2023-09-20T15:47:43.63+00:00
Sat 0 Reputation points
answered 2023-09-21T09:05:14.0666667+00:00
Sat 0 Reputation points
2 answers One of the answers was accepted by the question author.

Is there a way to troubleshoot an Unknown error when trying to use Set-MsolUserLicense in Powershell?

I have generated this test code to attempt assigning user license assignments to Azure via PowerShell. However, everything functions except the License Assignment. I have debugged every line and narrowed it down to an Unknown error during the…

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
16,514 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
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,084 questions
asked 2023-09-18T15:45:25.3166667+00:00
TristanDevOps 20 Reputation points
commented 2023-09-21T06:11:12.0266667+00:00
Vasil Michev 79,136 Reputation points MVP
1 answer

how to replace an account executing a schedule task by gmsa using powershell

Good morning, I have a hundred scheduled tasks which are executed by a so-called "service" account, but which is I created a gMSA that I want to position on around fifty planned tasks. Manually when I modify the execution account individually…

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
10,539 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,084 questions
asked 2023-09-20T13:23:30.3166667+00:00
Mohamed SAKHO 96 Reputation points
answered 2023-09-20T18:09:15.4433333+00:00
Rich Matheisen 41,436 Reputation points
1 answer

How to export device local admin password using Microsoft graph Api using PowerShell

Am having a problem exporting local admin password for devices configured with LAPS using Microsoft graph api. The conventional get-lapsadpassword cmdlet works fine but graph api doesn't. I suspect the problem is in the query endpoint because when i run…

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
16,514 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
2,051 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,084 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,288 questions
asked 2023-09-20T11:52:19.74+00:00
Benard Mwanza 996 Reputation points
answered 2023-09-20T17:59:15.3033333+00:00
Chandan Bilvaraj 0 Reputation points
4 answers One of the answers was accepted by the question author.

dsregcmd /status

You will have to forgive me. I am new to the command line and bat files so hopefully this is an easy question. When I run the dsregcmd /status it spits out a ton of info, ultimately i am interested in the "Device State" information. Is there…

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,084 questions
asked 2022-06-17T12:53:12.473+00:00
steck35 81 Reputation points
answered 2023-09-20T17:16:45.49+00:00
Bill Powell 0 Reputation points
0 answers

Block in hyper V mode

Hello, I'm asking a question here because I haven't found an explanation anywhere on the Internet. I explain, I don't know how but I converted my administrator user account into a Hyper V account. I don't know at all how to go back. This option…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
8,802 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,108 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,267 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,084 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,288 questions
asked 2023-09-20T12:20:09.91+00:00
20R08_ 0 Reputation points
1 answer

How to delete managed devices on Intune with Powershell?

I would like to know how to delete an Intune device using Powershell at the command level. I'm guessing the command is as follows, but I don't know the options, so I'd appreciate it if you could enlighten me. Command: Remove-DeviceManagement

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,084 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
3,291 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,288 questions
asked 2023-09-11T08:08:48.4066667+00:00
情報S管理者 0 Reputation points
commented 2023-09-20T07:32:46.03+00:00
Lu Dai-MSFT 27,366 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Set-AzServiceBusGeoDRConfigurationFailOver error in Azure automation account

I am trying to trigger failover between my service bus namespaces. When I run the following command locally from my computer, it works fine. However, when I run it from a runbook in azure automation (PowerShell), it fails with the following error: A…

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
944 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,084 questions
asked 2023-09-20T01:16:29.63+00:00
pancakes0111992 20 Reputation points
accepted 2023-09-20T06:42:03.2066667+00:00
pancakes0111992 20 Reputation points
2 answers One of the answers was accepted by the question author.

PowerShell starts running on its own, consumes most of the memory and cannot play my game.

Recently I have noticed that PowerShell would start running while I am playing a game (genshin impact). The window flashes for a short while and it disappears from taskbar. And then I noticed, the game would lag a lot! Even the simple static page 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,084 questions
asked 2023-01-08T19:06:43.637+00:00
Kaustubh Kulkarni 36 Reputation points
edited a comment 2023-09-19T02:49:10.7666667+00:00
Piqler Studio 0 Reputation points
3 answers

Find domain disabled users (in all sub-OU's)

Dear all, I'm working on a script that can find disabled user accounts within any Active Directory sub-OU of the domain. I tried the cmdlets Search-ADAccount and Get-ADUser, but it always ends up finding only two disabled user accounts located in…

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,084 questions
asked 2020-12-05T00:05:59.033+00:00
Andrea Rochira 1 Reputation point
commented 2023-09-18T14:57:29.84+00:00
Rich Matheisen 41,436 Reputation points
1 answer One of the answers was accepted by the question author.

Problems with DNS policy

Hi, community. I made a DNS policy for subnet, zone scope and added record type A. My A record, made above, resolving on client from subnet, it's OK. But while policy enabled, that client can't resolving other records in domain. Appears error: ***…

Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,141 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
4,833 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,084 questions
asked 2023-09-15T14:37:24.6766667+00:00
Nick Tuktarov 20 Reputation points
commented 2023-09-18T12:54:17.14+00:00
Gary Reynolds 9,106 Reputation points
1 answer

Programatically item level restore VM with Azure Backup

Anyone using Azure Backup for VMs who’s managed to do item-level restore (to original location) programmatically? With Powershell I get stuck at the step where I get the ”mount script” (exe) & password. Restoring entire VM is super easy because that…

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
975 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
5,909 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,084 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,288 questions
asked 2023-09-11T14:55:23.8933333+00:00
Dennis 0 Reputation points
commented 2023-09-18T05:53:37.68+00:00
SadiqhAhmed-MSFT 30,796 Reputation points Microsoft Employee
1 answer

How to disable and enableusb on one GPO

Hello Everyone I will create two GPOs. one GPO with the name DisableUSB and one enableUSB. disableUSB I set authenticated users, all users apply GPO. and enable USB add the user you want to enable. when run on the user's laptop the function is still…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,968 questions
Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
3,025 questions
Windows Server 2012
Windows Server 2012
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
1,397 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
10,539 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,084 questions
asked 2023-09-18T01:33:24.31+00:00
AD365 Admin 0 Reputation points
answered 2023-09-18T05:53:13.17+00:00
Amit Singh 4,041 Reputation points
3 answers One of the answers was accepted by the question author.

How to export certain users from AD through matching users in csv file, in PowerShell?

Hi I have a list of users in a CSV file (600 user), and I want to use this CSV file to match it with AD users in order to extract/export from AD the users who matches with users in the CSV file using PowerShell, I will export each user with its…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,968 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
10,539 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
4,833 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,084 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,288 questions
asked 2023-09-14T17:37:46.4366667+00:00
SysAdmin 121 Reputation points
edited an answer 2023-09-17T15:23:14.79+00:00
Rich Matheisen 41,436 Reputation points
3 answers

How can I batch download multiple dropbox links from a website?

I'm browsing a site whose author includes multiple links to files on Dropbox. I want to download all of them without clicking each individual link. I have several Chrome extensions that batch download files, but they download the html "preview"…

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,084 questions
asked 2022-08-22T12:08:56.72+00:00
ahmedali98k 1 Reputation point
answered 2023-09-16T07:41:30.5533333+00:00
Anonymous
7 answers

powershell login error

hi all i am new to powershell and azure world. i am trying to login to my office365 azure using powershell. my admin account is MFA enabled. i am using connect-azuread command. i get the prompt to enter username/password and then approve the request…

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
16,514 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,084 questions
asked 2021-02-05T01:31:45.19+00:00
ABBA 46 Reputation points
commented 2023-09-15T06:53:30.9766667+00:00
Viktor Ninov 0 Reputation points
0 answers

Wi-Fi disconnected by WSL

Wi-Fi disconnects when starting docker desktop or Ubuntu on WSL2. Ubuntu on WSL2 also cannot connect to the network. Wi-Fi reconnects when vEthernet (WSL) is disabled in changing adapter options. What kind of settings should I do to prevent Wi-Fi…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
8,802 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,084 questions
asked 2023-09-15T03:28:18.8766667+00:00
Nogami Youhei 0 Reputation points
3 answers

Powershell script - Sharepoint online - Copy Library contents to another library in a different site & filter the files copied.

Hi, I would like to get some help with creating a script. The powershell script needs to have the ability to sign in to sharepoint, have input prompts for site, site pages and library to copy from and to. I need to be able to copy library content files…

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
8,017 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,084 questions
asked 2022-05-23T23:09:00.387+00:00
Nigel Foot 76 Reputation points
edited an answer 2023-09-15T02:22:25.4233333+00:00
Yanli Jiang - MSFT 16,281 Reputation points Microsoft Vendor
1 answer

Compiling script components in SSIS package through code

Actually, we have SSIS packages built in visual studio 2017 and target version as Sql server 2016 and now as part of new changes, we are updating the sql server installed version from 2016 to 2022. because of this, we changed the visual studio to 2019…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
10,896 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,224 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,937 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,084 questions
asked 2023-09-14T11:17:08.1566667+00:00
LVS Raghu Vamsi 40 Reputation points
edited the question 2023-09-15T01:27:11.76+00:00
Tianyu Sun-MSFT 20,681 Reputation points Microsoft Vendor