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)

-4
votes
1answer
75 views

Power shell script to get Computer Description + OU details [closed]

Power shell script to get Computer Description + OU details I do not get any output when I try PS C:\Windows\System32> Get-ADComputer -Computername "ABCD1DT001" I need to be able to get ...
1
vote
1answer
31 views

Need script to find error in sqlcmd script

I have below command to take the backup of sql database in windows and now we need to set exception handling code in it to trigger an email alert if any errors "sqlcmd -S $serverip -U $dbuser -P ...
0
votes
0answers
115 views

Schedule powershell script task doesn't Send-MailMessage

I am building a Powershell script to create a company synchronized email signature so I don't have to ask users to manually edit theirs when information changes. It is set up to grab the contents of ...
1
vote
1answer
34 views

Strange e-mail behavior in powershell

I'm adding a new powershell piece into my user creation, which is to e-mail their supervisor with an alert that they have been created. However, for some reason, it sends the credentials to the next ...
0
votes
0answers
43 views

ICACLS not working from PowerShell

I created a BAT file that executes this C:\Windows\system32\icacls.exe "F:\Users\username" /inheritance:r /T /C /Q It works fine. When I copy the command within a PowerShell, I get error ...
0
votes
1answer
67 views

powershell export local store certificate to pfx without password enters password

using certutil is pretty straight forward: certutil -exportpfx -p "" my serialnr path\to\hostname.pfx noroot I need to convert it from pfx to pem, so I need to do some scripting. This is what I ...
0
votes
1answer
36 views

Powershell ISE recognised the cmdlets but not in powershell console

In the powershell ISE we can run the cmdlets which are loaded from the modules defined in the script . But the same script is not working from the powershell console. Please let me know how to make ...
3
votes
2answers
252 views

Killing Parent and Child processes on Remote with Powershell

I'm attempting to kill a parent process and it's child process (There will only be one child) on a remote computer. When executing this script (Which is part of a larger one) i get the following ...
2
votes
1answer
82 views

Exception when running PSExec on remote computer

Running this command $processesToSpawn = 3 for($i= 1; $i -le $processesToSpawn; $i++){ psexec \\computername -i 2 -u "username" -p "password" "c:\myapp.exe" } Produces the ...
1
vote
0answers
61 views

Windows Management Framework 4.0 via GPO

I'm planning to set up a PowerShell-Masterserver. In order to do that I want to make sure that every Computer and Server running Windows 7 or Windows Server 2008 R2 has PowerShell 4.0 installed. To ...
0
votes
0answers
28 views

DNS server help not found in powershell?

I have run Update-Help on my Server Core 2012R2 machine, but when I run get-help on any cmdlets from the DNS server, it says it cannot find the help files on the computer and suggests running ...
0
votes
1answer
67 views

Windows PowerShell - How to view commands history date/time [closed]

I want to list entered commands in Windows PowerShell with their respective timestamps. How can I do it with Get-History command? Also if that isn't doable then please show me a way to check which ...
0
votes
1answer
75 views

Testing 3 conditions in Powershell IF statement is driving me batty

I'm trying to drive one of six outcomes from the combination of three variables being a '0' or '1' and I can't get the right output when testing three conditions no matter how I try. I've tried 3 ...
1
vote
0answers
31 views

Remote Desktop Farm Deployment ports

I'm in an environment where the firewall is very strict (as in every port is closed unless requested to be opened). When deploying my 2008 R2 Remote Desktop Farm through PowerShell I'm getting to ...
1
vote
1answer
107 views

Bulk import to AD powershell

I'm trying to import en employee list into AD using powershell. The script needs to update exisisting AD objects. The problem I have is that some users will have mobile number some internal numbers ...
1
vote
0answers
26 views

Hyper-V 2012 R2 x64 UpdateID

I'm trying to write a powershell script in order to manage my updates for multiple Hyper-V 2012 R2 machines. To problem i stumbled upon is that i am unable to find the updateId for it so i can manage ...
1
vote
2answers
46 views

How to connect to sql server to take backup of a database from powershell

I am new to powershell. I got requirement to take the backup of MS sql database backup from the other machine and not within the server. Can you please let me know what possible utilities required to ...
2
votes
2answers
130 views

Powershell Scripts works for 10 months, suddenly stops working

When I create my new users every week, I execute this powershell scripts I put together. It has been working like a charm for 10 months, but as of last week started throwing this strange error: ...
0
votes
2answers
179 views

Windows Server notify when installing updates finished

The Windows Servers in our environment (2008 R2 and 2012 R2) install updates automatically once a month, but don't restart automatically (yet), because the WSUS server should be the last server to ...
2
votes
1answer
332 views

Get-AzureRmResourceGroup not returning resources from current subscription

If I run Get-AzureSubscription -Current I get: SubscriptionId : a*<guid> SubscriptionName : Development Environment : AzureCloud ...
4
votes
1answer
178 views

No results when trying to populate array in a function

I am trying to use a function to populate an array with computer names to pass on to another part of a script. I am pinging all computer names in an OU and when it comes back as online, I would like ...
5
votes
3answers
2k views

Allow Standard User to Run Program as Local Admin Without Elevation Prompt

I work in an environment where local admin privileges for users isn't allowed. At all. This is very nice, but can be also be a pain when employees who must have local admin permissions to run a ...
3
votes
1answer
168 views

How do I stop service on remote server, that's not connected to a domain, using a non admin user via PowerShell

I've got the start of the script to achieve this: $SecurePassword = ConvertTo-SecureString –String $Password –AsPlainText -Force $Credential = New-Object -TypeName ...
3
votes
2answers
305 views

Exporting All Groups and Group Members from Active Directory

I am relatively new to powershell and am trying to get a list of all groups in the domain with their respective members. Here's what I'm working with now: Import-Module ActiveDirectory $OutPutFile = ...
2
votes
2answers
249 views

Access Denied Importing Certificate on Remote Machine

I'm trying to come up with a way to push out a certificate for install on multiple machines. The method I came up with is: Invoke-Command ServerName {Import-Certificate -FilePath "path" ` ...
-3
votes
1answer
88 views

Acess remotely to registry with Powershell [closed]

I would like to access remotely to the registry of a Windows machine to see some keys under "SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" with a Powershell script I ...
1
vote
0answers
35 views

PowerShell - Simple local security CmdLets

As of 2015, are there any simple CmdLets, either in an MS module or a community project, for managing roles and permissions and ACLs, as easy to use as the old DOS commands, e.g. net localgroup? I ...
1
vote
0answers
39 views

Configure cloud-config using Azure Powershell 1.0

I have spent some significant time getting an Azure PS script starting up a few CoreOS instances. I have everything working except I have no clue how to get the cloud-config added. Using the CLI, ...
3
votes
2answers
413 views

Run PowerShell script with Service Start

I'd like to set the Affinity and Priority of a service process when it is started (without modifying the service/process code, I don't own the code, it's a 3rd party service). I know I can do: ...
4
votes
1answer
135 views

Does Windows Firewall need to be on to enable PowerShell remoting on Windows 2008/2012 servers?

Does Windows Firewall need to be on to enable PowerShell remoting on Windows 2008/2012 servers? That is, if the Windows Firewall on a 2008/2008 R2/2012 R2 server is turned off can PowerShell remoting ...
0
votes
4answers
4k views

Export simple list of all computers in multiple OU's in AD [closed]

I have a program that selects which computers to connect to based on a text document. The list needs to only have the Computer names, 1 on each line. Nothing else. I'm needing a command or script ...
4
votes
0answers
198 views

Using get-wsuscomputer with -ComputerUpdateStatus

I have WSUS installed on a Server 2012R2 box. I am trying to use the Get-WsusComputer powershell command to get a list of computers with pending or failed updates. The documentation for the command ...
2
votes
1answer
175 views

Powershell Remoting security implications by adding users to WinRMRemoteWMIUsers

In our current workflow, we have to RDP to several servers just to know if a service is up-and-running. We do not have admin rights to those servers but are allowed to view, start and stop services. ...
2
votes
1answer
106 views

Power-Shell get-service commandlet - how to expand possible values for service status

If I run get-service it may return different statuses (0-4/Running, Stopped, Stopping, Running). Can I somehow expand a list of possible values for status by issuing PowerShell commandlet? I tried ...
2
votes
1answer
144 views

How to safely swap/replace a PhysicalDisk in a Parity Storage Pool

I have Storage Space configured with Parity resiliency that has a total of 5 SATA drives. 4 of the drives are near full capacity (90% used). I am now getting a low capacity warning because this. I ...
3
votes
2answers
135 views

Configuration of RelayIPList using CimObject breaks Windows SMTP server

I am trying to configure Windows Server 2012 SMTP server using PowerShell. I plumbed for using the IISSmtpServerSettings CimObject. I get the object, apply my change (allow localhost to relay sender ...
3
votes
1answer
1k views

How can I get a static download link for a Microsoft MSDN Subscriber Download?

I need to be able to download MSDN ISO files directly from power shell, and therefore I am wondering how can I do this? I can view the downloads site at ...
4
votes
1answer
147 views

Export Firewall Rules using PowerShell that include Program Path

I'm looking for a way to export existing Windows Firewall rules using PowerShell that includes the path of the Program being referenced (for those rules which reference a program path instead of a ...
1
vote
1answer
49 views

How to change a VM's checkpoint type from Production to Standard using powershell

I need to change the checkpoint type from "Production" to "Standard" using powershell. My current script for creating the new vm is pasted here, but that creates a VM with "Production" checkpoints. ...
4
votes
1answer
108 views

Do you Suspend-ClusterNode before or after Move-ClusterGroup?

Which do you do first to avoid service interruption? Or does it not matter? Is it: Suspend-ClusterNode -Drain Get-ClusterNode $env:COMPUTERNAME | Get-ClusterGroup | Move-ClusterGroup or: ...
0
votes
1answer
147 views

New-PSSession with Exchange On premises failing “Access is denied”

I have a script that runs from a web server via a web page that connects to an exchange server (exchange 2013 on windows 2012 R2). The web server is running Windows 2012 R2. The script runs under the ...
-2
votes
2answers
250 views

Powershell script to restart automatic Windows services and notify if failed

I found a Powershell script that checks all automatic services on Windows servers and if they are not started, tries to start them. Here is the link ...
-2
votes
1answer
36 views

Modify multiple accounts script

I need a script to make modifications on multiple accounts. Within the account, in general info, the display name should include “name +surname” + Custom Title. So the script should just add the ...
0
votes
0answers
41 views

IIS - Rewrite with PowerShell

I want to add a URL redirect rule to a specific Web.Config/Site. I know how I can do it with the GUI. I know how I can do it with the Web.Config. (The URL Rewrite Module is installed) But how can I ...
0
votes
1answer
53 views

Powershell archiving script

I found the below powershell script on "Hey, Scripting Guy! Blog" it is a great arching script. I modified it to meet my needs of a log file being created and sending an email. However i discovered ...
3
votes
0answers
124 views

Powershell DSC File copy - Workgroup machines

I've got a machine that I need to copy files to from a network share (on domain) for a deployment from a machine that's off domain. Currently I have the following code; Configuration deployWebsite ...
1
vote
1answer
81 views

Is there a supported Windows CIM/WMI provider for Dell PERC Generation 11 or later?

I have Dell OpenManage Server Administrator (version 7.4) for Windows installed on a 12th generation server with a PERC H710P. That machine has a root\cimv2\dell namespace which does not seem to ...
1
vote
4answers
135 views

How can I tell which of my nested AD groups a user is member of?

I have a set of nested AD groups: group subgroup1 subsubgroup1a subsubgroup2b subgroup2 subsubgroup2a userXY subsubgroup2b I'm using "group" to grant access ...
2
votes
1answer
42 views

Accessing DelegateListLink Property in Exchange Online?

I need to give a couple of users ReadPermissions to some mailboxes. And I need the read-only mailboxes to appear in the users' Outlook via auto-mapping. I know that you can achieve this via the ...
1
vote
2answers
1k views

Powershell - Find all users with password never expires

I am looking to query AD via Powershell in order to see all user accounts within my forest who have their password set to never expire. I found a few scripts online using a quick google search but ...