An interactive shell, scripting and programming language, and surrounding environment from Microsoft. Commonly used by system administrators managing Microsoft software (including Windows, Exchange, SharePoint, and cloud services Azure and Office 365), PowerShell is included by default with Windows, ...

learn more… | top users | synonyms (1)

-3
votes
1answer
54 views

script to know application pool,bindings [closed]

Do we have any powershell command or powershell script to get the website details as website name, application pools associated to,.Net version,bindings mapped to website. do we have a single line ...
1
vote
2answers
66 views

Azure Powershell - Change Directory

When I login to the new Azure Portal I see a drop-down at the top right that lets me select a "Directory" from a list of 2. When I login to azure using powershell cmdlet "Login-AzureRmAccount" I am ...
1
vote
0answers
17 views

dsc local configuration manager email me whenever change occurs

I'm running DSC with ConfigurationMode set to "ApplyAndAutoCorrect" It works fine as it is fixing any issues withing 15 minutes which is default. I would like to get notified by any means whenever ...
0
votes
1answer
37 views

Powershell: Executing Base64 commands returns error?

I need help with a simple test case of executing a CLI command through PowerShell which has already been encoded in Base64. Suppose Get-ChildItem has been converted in advance to Base64 string ...
2
votes
1answer
104 views

A non-recoverable error occurred during a database lookup

Short version: Why does Test-Connection report "A non-recoverable error occurred during a database lookup" for an offline host on a different subnet? I'm using PowerShell to ping a remote host with ...
0
votes
1answer
53 views

Azurerm powershell Cannot bind parameter and Cannot convert the value

even I can see the virtual network still can not get the specific virtual network subnet info from Azure powershell1.4.0. PS C:\Users\mwang> Get-AzureRmVirtualNetwork |more |Select-String name |more ...
0
votes
1answer
34 views

WinRM-Service is running but can't be reached

I have a virtual testing environment for developing scripts. As .NET isn't capable of all the possibilities PowerShell offers I use Remote PowerShell Runspaces. My problem is now, that I can't reach ...
0
votes
1answer
22 views

set the screenbuffersize of powershell console using cmd

For powershell version: 2.0 and 4.0 Is there a command used set the screenbuffersize of powershell console? I need to set the property of powershell console, not default size. I have tried the below ...
0
votes
1answer
68 views

Powershell Abbreviations?

I have a question about how PS abbreviates various commands, particularly when initializing a PS session. Let's assume we're starting at a Windows DOS Prompt: C:\> powershell -exec bypass I ...
0
votes
1answer
16 views

Create a backup on a remote share using Powershell

I have a backup script that is supposed to target a specific local folder and backup the folder to a remote shared folder on another server. When I run my script, Powershell prompts me with the ...
1
vote
1answer
32 views

Get all emails sent to particular email address and not the mailbox (alias')

I'd like to see all emails sent to a particular email address rather than the full mailbox with all alias'. e.g. if bob@example.com is the primary email address and bob@example2.com is an alias, i'd ...
0
votes
1answer
44 views

Check `Restore on AC/Power Loss` from CMD/Powershell on windows 10

I've set the Restore on AC/Power Loss from the windows Bios menu on computer startup for a few Windows machines. How can someone confirm (remotely) that I have done that, is there a way to do this ...
-1
votes
1answer
39 views

Powershell script to take and delete snapshots

Im new to powershell and i want to create a script to take a snapshot of all the running vm's and delete the snapshots that have more than lest say 5 days. What i have is this: $Time = 5 $VMs = Get-...
1
vote
1answer
36 views

set-aduser inside foreach loop

I'm trying to get the below script to change three things on an AD account. I want it to expire the account, change an attribute, and append disabled account to the current description. It does ...
0
votes
0answers
17 views

Retrieve VM information from VCloud

In a development shop, we have a large number of VMs with complete installations of our applications, with client, server and database VMs in a single vApp. The people who create the VMs do not keep a ...
1
vote
1answer
31 views

Get bool return value when checking if smb1 is enabled using powershell

I can use Get-SmbServerConfiguration | Select EnableSMB2Protocol to get table style result: How can I get bool result which in this case would be False I'm working on DSC, and currently ...
0
votes
1answer
63 views

script parsing results to the same email

I am outputting the results of a powershell script to a html file which is emailed to me via exchange, I need to get the script to stop parsing the results to the same email and create a new email on ...
0
votes
0answers
102 views

EC2 Cloudformation - userdata using powershell to retrieve powershell scrips from GitHub

I have a AWS cloudforamtion - whih build my entire VPC with subnets etc - within this CF builds a windows 2012 server - we want to bootstrap this server under user data so it become a domain ...
3
votes
1answer
141 views

What is the supported way to check where my managed service accounts are installed?

I created a managed service account (not a gMSA) and installed it on a 2012 server with Install-ADServiceAccount. Now I want to be able to check where my MSA are installed (throughout the domain) ...
0
votes
1answer
111 views

Assistance with writing PowerShell script to search Active Directory for a machine name

I'm writing a script to automate some AWS-launched Windows server instances. I've got the DNS changes, and the join-domain part okay, but I'm having trouble iterating the namespace...for example; ...
0
votes
0answers
60 views

Access denied when running some remote PowerShell commands

I have configured WinRM (PowerShell Remoting) on four machines that I administer. On all machines but one I can run both of these commands remotely with no issue. On one cursed machine, Get-Command ...
-2
votes
1answer
34 views

Windows domain list users details where password never expires [closed]

I have a Windows domain, where I need to find users with option to never expire password enabled - as a part of an audit and for contacting them. I have no rights to install any fancy Powershell parts ...
-3
votes
1answer
46 views

Built-In PowerShell Module Path

I'm trying to figure out where the built-in modules are hosted in the filesystem. I would've thought it an easy task, but I'm not having much luck. Most/all of the Google results are about getting the ...
5
votes
1answer
60 views

Get witness disk current vote via PowerShell

I am trying to verify functionality of dynamic quorum in a new failover cluster setup. Is there a command in PowerShell that I can use to see the current vote for the witness disk? I have been ...
0
votes
1answer
25 views

Printer Audit 64bit

I'm running the following script to get a report on installed printers : https://community.spiceworks.com/scripts/show/2186-export-printer-information-to-spreadsheet?page=1 However when the script ...
1
vote
1answer
72 views

Script for user movement based on OU

Any script which will read the department attribute of users (under an OU and sub OU's) and move them to different OU named as department ( already created OU structure name same as their department ...
0
votes
2answers
135 views

How to calculator IP range and subnets? [closed]

I am trying to find exact formula for finding the IP ranges for the below sample input 10.144.26.192/28 I am getting different IP count in different portals. I used the below online IP range ...
2
votes
0answers
42 views

Changing Windows Server 2012R2 maintenance time with PS

I'm struggling with this for the past few weeks and I hope someone has THE answer that works. At my work we use VMWare and I've build a automated deployment of Windows server 2012R2 with Powershell, ...
2
votes
2answers
92 views

How can I use PowerShell to enable NTFS compression, in place, on log files older than x days?

I have an application server, running Windows 2012 R2, which generates a high volume of log files, to the point that it runs the application volume out of free space on a semi-regular basis. Due to ...
1
vote
0answers
46 views

How to disable “do not allow drive redirection” local policy not using GUI?

I need to do it preferably using powershell/batch but after searching there is only some instructions for creatig adm/admx files. Is there an easier way to do this? I've also found a registry key ...
1
vote
2answers
35 views

Exchange 2010 | Get-MailboxStatistics where clause

I have exchange server hosting emails for multiple domains. How can I make the Get-MailboxStatistics cmdlet to display mailboxes and sizes only on mailboxes that end with a certain domain? Something ...
-2
votes
1answer
47 views

How can I add firewall rules remotely without GPO?

I know the best way to do this is through group policy, however that's not an option right now due to our really old server running Win Server SB 2003 (we're planning on decommissioning it asap, but ...
1
vote
1answer
49 views

Assistance with Powershell Do While loop

I am writing a powershell script to create a new user in AD and then add a mailbox to them. The issue I am experiencing is that the script runs too fast and tries to jump to the next step (enabling ...
0
votes
2answers
46 views

how to release shared files' locks from other systems before server downtime - with Powershell?

Is there a way to use Powershell to clean up/release file locks on a server when it's time to upgrade? we have other systems connecting to the server's shared resources over the network and some files ...
3
votes
2answers
64 views

script to temporarily block remote users from logging into a windows server during downtime

I'm looking for a solution to the following issue: we have a windows server with a bunch of people logging in remotely to work on stuff; when we need to upgrade the server, we issue warnings via ...
-1
votes
1answer
53 views

WinRM cannot connect

I am trying to get two workgroup machines (both are Windows 2012 R2) to talk to each other using PowerShell via WinRM. Let's call them ServerA and ServerB. On both machines I ran the following ...
0
votes
1answer
23 views

Getting List of Members for DL's from .csv/.txt

I've been tasked with getting a list of all members for a list of 500+ distribution lists (DLs). I currently have the list (of DLs) in an excel/csv that basically lists the names and primary smtp ...
5
votes
1answer
183 views

Get-ADGroupMember $Group fails when $Group contains principals from other domains

I've noticed that when I use Powershell to get the group membership of an Active Directory domain security group, the Powershell cmdlet Get-ADGroupMember $Group fails with the error message: PS C:\&...
0
votes
1answer
20 views

List a server's available WMI Performance data classes

How can I get a list of all WMI performance counters classes on a given server, to use in scripts for monitoring purposes. I know one can use the performance monitor, but the classes displayed don't ...
1
vote
1answer
135 views

Check If A Service Account Has Logon Interactive Privileges

I want to loop over all my domain service accounts and make sure that people can't log on the server using that account. How can I check if a service account has interactive logon privileges and/or ...
1
vote
1answer
39 views

Powershell and par2 command line

I have a working script which 7zips sql bak files to a network location (helped by the good people here:)). since 7zip doesn't have recovery records i would like to use par2. now, i have put together ...
0
votes
0answers
40 views

NPS RADIUS 802.1x and configuring for large number of VLAN-s

Problem I've got a network with large number of VLAN-s (200+), and ActiveDirectory with 2012R2 servers, with all users and computers. I've also got NPS RADIUS server setup, properly working with ...
2
votes
0answers
56 views

Why does Get-Winevent in parallel workflow wants to use PSRemoting?

I'm building a wrapper script for Get-Winevent to search multiple computers' event logs in parallel, using multiple search criteria. I'm contructing a XML filter for Get-Winevent, then call this ...
1
vote
2answers
153 views

Getting NIC speed from Powershell on Win2008 R2 Server

I am trying to get the NIC speed via Powershell on some of my servers. For my lab server I know there is a 1GB NIC in there. However, when I do this via Powershell I get the below weird number: Get-...
1
vote
0answers
32 views

Get-WmiCounter Win32_PerfFormattedData_NETFramework_NETCLRMemory Incomplete in non admin context

So I have created a script to gather counters using Get-CimInstance (which supercedes Get-WMIObject) and run it as a services via srvany.exe. I get an issue where for the .Net CLR classes, some ...
2
votes
1answer
60 views

Server 2012 R2 - Features on Demand - role not actually being removed

This is for learning purposes: I'm running a Server r2 machine and I'm trying to remove feature WINS. I run uninstall-windowsfeature WINS -restart -remove, I then restart, and then run get-...
0
votes
1answer
53 views

JSON Parse Error in Windows Sensu Client Powershell Setup Script - unexpected character at line 1, column 1

I am creating a install script for Sensu on Windows and am getting this error upon starting the service: { "timestamp": "2016-04-14T23:05:45.043371+0100", "level": "warn", "message": "config ...
1
vote
1answer
305 views

How to get ADDSDeployment module on Windows Server 2008 R2 SP1

I wonder to use AD DS Demployment CMDLets (Install-ADDSDomain, etc.) on Windows Server 2008 R2 SP1. I have installed AD-Domain-Services feature and in the list of available modules (Get-Module -...
0
votes
1answer
23 views

Testing if PowerShell script is being ran via Enter-PSSession?

I've got a PowerShell 2.0 script which performs some tasks involving non-MS apps which it launches. This works great if running via RDP or local console, but ends up deleting files when not intended ...
0
votes
1answer
78 views

Server 2012 R2 - Features on Demand issue with powershell - Pulling roles/features from remote share

This is for learning/lab purposes. -Two 2012 R2 servers. Server 1 is Standard GUI and server 2 is Server core. -Server 1 is updated, Server 2 is not updated at all with any windows updates -Workgroup ...