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)

1
vote
1answer
277 views

PowerShell out-gridview cmdlet asks for PowerShell ISE but it is already installed

I am trying to use the Out-GridView cmdlet on a Windows Server 2008 R2 box. It complains that it can't run because I need to install the Windows Powershell Integrated Scripting Environment feature. ...
1
vote
0answers
3k views

Copying files from local server to remote server using powershell

Apologies if this has already answered directly or indirectly in SF. My requirement will be as follows: Move a deployment folder that has got files and subdirectories to a remote sever. Pass ...
4
votes
1answer
1k views

Running PowerShell scripts as an Application in MDT 2013

Is there a way to make powershell scripts run under the applications list so that when you install from the MDT image you can select which scripts you want to run? I can run the scripts fine as ...
0
votes
0answers
41 views

Automating Application Dependencies and Return Codes

I'm developing an end-to-end Application creation automation into SCCM 2012 from Orchestrator 2012. I've fully completed it using the MS PowerShell cmdlets as well as WMI manipulation, and PowerShell ...
0
votes
1answer
248 views

Installing SQL remotely using Invoke-Command

i'm trying to install SQL Server 2012 on Win 2012 r2 server remotely via Powershell using Invoke-Command, but it fails with this error "Validation for setting 'SQLSVCACCOUNT' failed. Error message: ...
1
vote
2answers
122 views

Check management server on SCOM 2012

I have to check about 400 machines for the management server as we have moved from SCOM 2007 to 2012 and we need to check if the old SCOM 2007 server is still being pointed at. On an individual ...
0
votes
0answers
308 views

Accessing Exchange server 2013 from window 7 using Remote PowerShell?

I am trying Remote PowerShell from Windows 7 to Exchange Server 2013. Following is the code snippet. public static void ConnectToPowerShell() { string password = "password"; ...
0
votes
2answers
995 views

PowerShell Firewall Management

I have a bunch of machines that I need to enable Remote Scheduled Tasks Management (RPC), Remote Scheduled Tasks Management (RPC-EPMAP), and Windows Management Instrumentation (WMI-in) on for GPO ...
1
vote
1answer
469 views

IIS 8: Setting the application pool username is ignored

I do this on IIS 7.5: Create an application pool, "testpool", and set the username and password to match one that exists in the AD. Then in powershell as administrator: Import-Module ...
2
votes
1answer
171 views

How to Resolve Hyper-V Disk Location to Drive Letter

When viewing cluster disk properties in Failover Manager or the physical path to VHD's in the settings of a VM in Hyper-V Manager the location is displayed by GUID. Is there a quick way find out ...
-2
votes
1answer
78 views

how can i find information about all exchange server in the organization?

Power Shell command Get-mailbox gives details of all the mailboxes on the server by which i am running this command. For example, i have two exchange server in my organization named server1 and ...
-1
votes
1answer
36 views

Query AD Users from date [closed]

How can I query users in AD that have been added since an specific date and that their user logon name starts with UTX ? Im guessing I need to do it with powershell but I have very little knowledge. ...
4
votes
1answer
194 views

Powershell DISM New-Windows Image: Using a CompressionType gives an error

PS C:\ProgramData\Microsoft\Windows\Hyper-V\BigHomie> New-WindowsImage -CapturePath K: -ImagePath C:\VHDImports\Win764.wim -name "BigHomies Personal Image" -Verify -CompressionType "Max" Throws ...
8
votes
2answers
897 views

ESXcli command timeout at 30 minutes

I am working on a powercli script to loop through each datastore in our environment and reclaim space on the thin provisioned LUNs. All LUNs in the environment are Dell Equal Logic. vCenter ...
1
vote
2answers
239 views

Powershell script:Loop/Array not retriving all AD Get Commands information: error “cannot bid parameter identity”

I have a powershell script that loops and retrieves AD information using get commands. At the moment its retrieving the selected information for account name and distinguised name. But if I add ...
0
votes
1answer
108 views

PowerShell won't rename an export .csv file

I am trying to rename the file export.csv to the $name but with a .csv extension instead of .file. The output is still $name.file. Import-Module ActiveDirectory $name = Read-Host "Enter Group Name" ...
0
votes
0answers
98 views

Make Azure Powershell cmdlet's available to team city

I have installed the Azure powershell cmdlet's via the web platform installer on my build server that is running TeamCity. However, when I setup a powershell build step I get an error: ...
2
votes
2answers
540 views

Copy-item FileSystem provider error

Copy-item cmdlet is not working as expected, i don't understand why. This is my code : $Source = "C:\folder1" $Destination = "\\172.22.0.115\c$\folder2\" $Password = ConvertTo-SecureString ...
-2
votes
2answers
404 views

Powershell script for retrieving AD information using piped Get commands then copy to csv file but getting “append” error

I am trying to run multiple Get Commands to retrieve AD information. I piped all of these commands and now I want to write the output to write all the the information ito one csv but at the moment i ...
2
votes
1answer
146 views

More efficient way to retrieve Office365 data via Powershell

I am trying to get mailbox statistics from Office 365. This is the current script: # Get credentials $O365Creds = New-Object -Typename System.Management.Automation.PSCredential -ArgumentList ...
10
votes
2answers
2k views

How do I convert a vhd to a wim file?

I just setup and sysprepped a nice new VM, now I need to convert it to a wim real quick, to upload to my sccm server. For some reason, I can't change the VM properties to boot from a legacy nic for ...
0
votes
2answers
467 views

PowerShell - Add multiple strings to the same element in an array

So I have a array that I need to search through line by line and divide up by interfaces. My code loops through this file line by line. I want to split up the interfaces by the "!" character and add ...
0
votes
1answer
88 views

Pstools or Powershell or Both

I'm having a problem at the moment deploying and managing windows services and I'm looking for advice on the best course of action. Here's what I have working (below) - the problem is it's a bit ...
0
votes
1answer
100 views

Grant user write access to DNS Server (Win2k8)

I want to remotely manipulate DNS records via Powershell scripts and I use the following script: $zone='company.local' $dnsrecord='dummyDNSrecord.company.local' $rec=Get-WmiObject -ComputerName ...
3
votes
1answer
136 views

Configure and monitor Windows 2012 DHCP server with Powershell

We've recently been working with the documentation here to set up some access policies for a new DHCP server. I've been able to successfully import 600+ records with the Set-DhcpServerv4Policy -Name ...
3
votes
2answers
246 views

Ensure drive is mapped at login on laptop with strictly wireless

So, $software runs on a 'server' (windows client w/ file sharing to share out the db folder), and laptop client has the drive mapped and $software also installed. This is the vendor's recommended ...
1
vote
1answer
115 views

What happens to active connections to my SQL Server DB if I back up the transaction log with the NORECOVERY option?

Some background: I'm migrating my SQL Server DBs to a new machine and I wrote a few Powershell scripts to send/apply full backups and transaction logs asynchronously to the new server, but my question ...
0
votes
0answers
59 views

Powershell deploment script into multiple 2003 windows servers

I have created a script "test.ps1" that runs security checks on folders within machines. Now I want to deploy this script into 70 windows servers so it can run these security checks on all of them. ...
6
votes
2answers
688 views

How to print out information about Task Scheduler in powershell script?

I am trying to print out information from the Task Scheduler from the local computer in a PowerShell script so other users can print out this information as well and not have to access the Task ...
2
votes
1answer
199 views

How do I set “CustomAttribute6” for a regular AD user?

I'm trying to set AD attribute 6 in Powershell to update a user who has no mailbox, and isn't an exchange contact; and is only an AD user ObjectClass : user The command I'm using is: get-adobject ...
2
votes
2answers
1k views

It cannot determine the content type of the HTTP response from the destination computer wsman

I am trying to connect to an Exchange server via a wsman connection using PowerShell. The client server in question is in a Workgroup, while the Exchange server is in its own domain. I use the ...
0
votes
1answer
462 views

Powershell Script not working

I have this scripts that should move Computers based no their subnet, but I keep on getting the following error and I can't for the life of me find the problem. I can manually move computers using ...
2
votes
3answers
1k views

PowerShell Import DnsShell Module

So here's the list of available modules in this directory. As you can see DnsShell is there. PS C:\windows\system32> Get-Module -ListAvailable Directory: ...
2
votes
2answers
245 views

How can I set an arbitrary (non default) attribute for an AD user or AD Contact?

I have AD Users, or contacts that are not Exchange Mailbox users, or contacts. I also have a SSO system (Ping Identity... technology similar to Microsoft ADFS), where it leverages the AD Schema ...
4
votes
3answers
2k views

How can I disable a scheduled task using Powershell?

I have a web application that runs on Windows Server 2008 R2, which has a large number of scheduled tasks which take care of all the backend stuff. When I do a software deployment which touches the ...
0
votes
2answers
156 views

non-GUI connection to local Hyper-V VM without network

I have a virtual machine on Hyper-V manager (Windows 2008 R2) without a network configured on the VM. From a powershell script running on the host Windows server, I would like to query into the OS of ...
1
vote
2answers
2k views

PowerShell - finding users who are Inactive AND not disabled

I wrote this cmdlet: Search-ADAccount -filter {(enabled -eq $true)} -Users Only -SearchBase "ou=FirstOU,dc=domain,dc=com" -AccountInactive -TimeSpan 30 But it outputs an error: Search-ADAccount : ...
4
votes
1answer
5k views

PowerShell - Finding all of users' group memberships and kicking it out of them

as title says, I have to find all the groups that the user is a member of, and deleting its membership from all of them. I've tried this: get-adgroup -filter * | where {(Get-ADGroupMember $_ | ...
2
votes
2answers
3k views

PowerShell - Limit the search to only one OU

Ive got this cmdlet and I'd like to limit the results to only one OU: Get-ADUser -Filter {(Enabled -eq $false)} | ? { ($_.distinguishedname -notlike '*Disabled Users*') } Now Ive tried to use ...
3
votes
3answers
3k views

PowerShell script that should find disabled users that are not in a specific OU outputs users from that OU as well

Hey I've got this cmdlet here: Get-ADUser -filter {(distinguishedName -notlike "Disabled Users") -and (enabled -eq $false)} -searchBase "ou=FirstOU,dc=domain,dc=com" I've built it to find disabled ...
1
vote
1answer
285 views

Trying to list out Web services, Web sites, and App Pools - Windows Server 2003

I am curious on how i would list out Web services, Web sites, and App Pools to a .txt file on a Windows Server 2003 machine. I have Powershell 2.0 configured and have been trying to run some scripts ...
1
vote
1answer
243 views

Turn Windows Features on or off, Windows 8, Windows Batch File

I am looking to produce a batch script that turns on a number of Windows Features as the same routine is currently performed on multiple machines, an example of this would be... Turn on Default ...
0
votes
1answer
32 views

Powershell waiting for more parameters when asking for all users from a specific OU?

I want to get all the users from OU "myusers" so I have this cmdlet right here: get-aduser -filter * -searchbase"ou=myusers,dc=domain,dc=com" But when Im running it, powershell prints a >> ...
0
votes
1answer
1k views

script to list user's mapped drive not giving results or error

We are in the process of migrating two file servers to a new server. We have mapped drives via user group in group policy. Many users have manually mapped drives and we need to find these mappings. ...
2
votes
2answers
229 views

How do I install and use the cli53 tools on Windows?

I'm trying to find the simplest way to import a large number of BIND zone files in to Route 53. I've had a quick look at the AWS CLI and AWS Tools for Windows PowerShell but they don't seem to include ...
2
votes
1answer
231 views

How to set RDS security layer in Windows Server 2008 R2 via PowerShell

I'm looking for a way to set security layer setting in Windows Server 2008 R2 RDS via PowerShell (other ways to do in programmatically will do also but PowerShell is preferable). Via GUI it can be set ...
0
votes
1answer
1k views

Powershell - check if all users in a specific OU are disabled, disable if not

I tried to search for it but I didn't find anything. Could someone help me out with an example of a script that would do this?
2
votes
1answer
382 views

How to setup a daily report of the top e-mail senders in Exchange 2010

We have had issues with compromised Exchange accounts sending a large amount of unsolicited e-mails out. We have mitigated this by using a cloud e-mail gateway that does a better job in detecting ...
2
votes
2answers
904 views

How do I combine two Powershell outputs so that command #2 is run on each output?

I want to combine the commands Get-user and get-casmailbox so that I can get the "Company" from the first output, and the "ActiveSyncStatus" in the latter into a single output. I also understand that ...
2
votes
1answer
120 views

Execute ps1 script when CPU threshold is meet

I'm looking for a function similar to Debug Diagnostics Collector. Where you can setup a performance (or any counter) trigger (eg. above 50% CPU over 50 seconds). Once condition of a trigger are ...