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)

2
votes
1answer
273 views

Active Directory Administrative Center Powershell

Natively Active Directory Administrative Center (ADAC) doesn't give you the powershell alternative when performing any function, like Exchange Management Console. Is there a way to change this or is ...
1
vote
5answers
6k views

Need help trying to allow my remote PowerShell script to run on my Windows 2008 r2 Server

I've got a Windows 2008 r2 server with Sql Server 2008 r2 installed. I've got a Sql Server Agent which tries to run a Powershell job, but fails :- Message Executed as user: FooServer\SqlServerUser. ...
5
votes
1answer
4k views

Powershell 2.0 Windows Server 2008 SP2 update does not apply to your system

I am trying to install Powershell 2.0 on a Windows Server 2008 SP2 box. According to the Microsoft download page, I need KB968930-x86.msu. I have downloaded that, but when I try to install it, I get ...
2
votes
1answer
212 views

Implementing Powershell .20 (WinRM Invoke-Item) in the secure Datacenter environment

How do you secure your Windows domain environment while still enabling the Powershell 2.0 remoting capabilities (WinRM invoke-item) ? Because at the moment my company datacenter would like to ...
4
votes
1answer
3k views

Powershell ActiveDirectory-Module on SBS-2008?

I read plenty of tutorials that describe how to install ADWS (ActiveDirectory Webservices) and Powershell. But I never saw any hint about installing ADWS on a SBS-2008 in order to work with Powershell ...
3
votes
1answer
762 views

Working with AD groups in PowerShell

I am creating AD accounts via a powershell script. It also adds a user to a second AD group. By default, this user is placed in the Domain Users group, which is the primary group. How can I... ...
1
vote
2answers
402 views

get-acl syntax problem

Could someone explain something to me? If I run the command (get-acl .\test.txt) | Select-Object owner, I get Owner ----- ...
6
votes
6answers
6k views

How to enable volume shadow copy using Powershell?

How to enable volume shadow copy on specific drive (D:, E:,...) and set up schedule using Powershell ? I just need some hints how to start.
0
votes
2answers
267 views

how to Automate the SQL Server 2008 Database and OLAP backup?

I have SQL Server 2008 Enterprise SP2 x64 database in my Windows Server 2008 Enterprise, my question is how to perform automated backup for both database content ? eg. the MDF and the LDF as well as ...
6
votes
2answers
23k views

Can't give 'send-as' permissions in Exchange 2010

I'm trying to give 'send-as' permissions to one user in Exchange 2010. Here is the Powershell command I'm running: Add-ADPermission "User1" -User "Ourdomain\User2" -Extendedrights "Send As" ...
2
votes
1answer
2k views

Associate .ps1 to powershell.exe through domain GPO on 2008r2

I need to associate .ps1 with powershell.exe instead of Notepad via GPO from a 2008r2 DC. I've seen one question mention CSE under Computer Configuration\Preferences\Control Panel Settings\Folder ...
4
votes
1answer
1k views

Get-ADComputer OperatingSystem property is missing

Although all the online documentation and examples state there should be an OperatingSystem property for the results of Get-ADComputer I don't have one on my Win Server 2008 R2. Here is all I have on ...
2
votes
2answers
535 views

Am I missing something about pushing a PS script via domain GPO

I've got a script that works. See here. Now my problem is getting it to run via a domain GPO. On my test clients, I've set the ExecutionPolicy to unrestricted. I've tried setting it as a startup ...
5
votes
2answers
7k views

Install .NET 4 via command line or PowerShell?

How do I install .NET 4 on Windows Server 2008 R2 from the command line or PowerShell? This post shows how to do it for .NET 3.5 using dism.exe and PowerShell. I am guessing that, since the .NET 4.0 ...
0
votes
2answers
761 views

Using powershell to gather disk used into a sql table

I have a script which connects to a db to get a list of servers to query and then queries them for disk space using a wmi query. Now I'd like to get these results into a table. I've run into a few ...
2
votes
1answer
5k views

Administer COM+ from PowerShell

Does anyone know of a PowerShell module or commands for administering COM+ components. In particular, I'd like to: Query whether a COM+ application is installed/registered. Start or Stop a COM+ ...
2
votes
3answers
836 views

Programmatically remove MSFT Security Essentials Anti-Virus from XP and Win7 machines

I need a way to remove MSFT Security Essentials so that I can install Forefront on the clients. I would prefer a login script that would pass administrator credentials to remove the program. If ...
0
votes
2answers
681 views

How to add user to list of Remote desktop users on remote machine using Powershell?

I wan't to make a script that connects to remote machine and add specific domain user to list of users who can connect to that machine using Remote Desktop. How to do that using Powershell?
1
vote
2answers
399 views

How can I find the file system usage of VMs only on particular devices?

I want to find the VM file system usage, but only on VMs that have a vmdk on a particular device. The VM host could have storage from multiple devices, for instance EMC and IBM devices. I only want ...
1
vote
1answer
803 views

SCOM, Powershell and SMTP

I have created a Powershell script that emulates a telnet connection to an SMTP Server, the purpose of this is to check our SMTP gateway server to see if there is issue with sending mail. The script ...
1
vote
3answers
318 views

Powershell Active Directory Cmdlets: Quest or Microsoft

Is there any reason to choose Quest's Active Directory cmdlets over Microsoft's at this point? I haven't come across anything that isn't doable with Microsoft's ActiveDirectory module yet, but I'm ...
1
vote
2answers
2k views

Trapping only exceptions that occur when an active directory user already exists using the New-QADUser cmdlet?

If I only want to trap an exception when a user already exists, what type of Exception should I trap? for instance: [UserAlreadyExistsException] trap{ #forget about it.... } ...
0
votes
1answer
828 views

Powershell Remoting always logs in as anonymous

I need some help in automating deploying some applications on my domain. The deployment process follows this basic flow in a Powers Shell script: Stop services Copy out applications Log into at ...
1
vote
2answers
613 views

How to use -WhatIf in the New-QADUser cmdlet?

I'm writing a powershell script and I want to find out the result of a New-QADUser command if the command fails. I found an argument to the New-QADUser command called -WhatIf (which I believe to be ...
1
vote
1answer
4k views

Powershell FTP Script Error: The remote server returned an error: 227 Entering Passive Mode

I am having Powershell FTP script problems. I have pulled my hair out over this one. I recently setup an "automated build server" for my software projects. All software projects get built and bundled ...
0
votes
4answers
10k views

How to register a DLL using PowerShell without RegAsm

I have an ASP Classic application which references some Visual Basic 6.0 COM objects. One of these Visual Basic 6.0 COM objects reference another third-party DLL. The third-party DLL needs to be ...
1
vote
2answers
277 views

Listing services on remote machine locks me out of the machine

I run a powershell command to list all of the services on a remote matchine: $b = 0; get-wmiobject win32_service -computer $computerName -credential $cred | select-object Name, ...
1
vote
2answers
2k views

Excluding Values from a CSV file in PowerShell

I'm trying to determine how to exclude values from an array based on a CSV file. This is the best option I have so far: $arrIgnore = import-csv "ignore.csv" foreach($objIgnore in $arrIgnore){ ...
0
votes
1answer
533 views

Discover network drives users have manually mapped via remote script

I am trying to write a script that will pull computer names from a text file, then query the remote registrys for any subkeys under hkey_users\SID\network. Then translate the SIDs into the username ...
0
votes
2answers
2k views

Missing something when adding AD users with powershell

I'm going round in circles and hoping someone can point me in the right direction... I have created a .csv file as follows SamAccountName,Name,GivenName,Surname,DisplayName,Type,Path,Logon ...
0
votes
3answers
6k views

Retrieve a user's Exchange database in powershell

I've scoured the interwebs for a few days now off and on to find this. I am creating a powershell script for email-enabling new user's(Exchange 2007). To give you a little background when we have a ...
0
votes
1answer
971 views

Powershell remote sessions and access to network resources

It seems I cannot access network resources in a remote Powershell session. This is using Powershell v2. Both the local and remote computers are on the same domain. As an example, if I am on MachineA ...
0
votes
2answers
494 views

Set initial program for Terminal Services user with Powershell (without active directory)

I'm running Terminal Services without Active Directory on Windows Server 2008. How can I set the startup program for a user via Powershell? Since I don't have the Active Directory role installed, it ...
1
vote
1answer
574 views

Exchange Server 2007 message tracking log tuning?

what is the best practice if I want to have a retention of let say 6 months ? I'm confused which parameter that is should/can be changes. Get-ExchangeServer | where {$_.isHubTransportServer -eq ...
3
votes
3answers
3k views

What is the best powershell script to restore an SQL Database?

To restore an SQL Server 2008 database, I would lile to be able to just do something like this in powershell: ./restore.ps1 DatabaseName.bak Then the powershell script would by convention restore it ...
0
votes
1answer
1k views

PowerShell: New-PSDrive error handling

I have a script where I mount with the command "New-PSDrive" a network drive. Now, since the script is running as a "cronjob" on a server I want to have some error detection. If for any reason the ...
0
votes
3answers
6k views

Exchange 2010 suppress Get-MailboxStatistics warnings

How do I suppress warnings from Exchange 2010's PowerShell Get-MailboxStatistics cmdlet? I've tried both of these options: Get-MailboxStatistics -WarningAction SilentlyContinue ...
0
votes
1answer
2k views

I get Get-WmiObject : Generic Failure error on an XP Machine. What needs to be done to get rid of this?

I am trying make an uninstall app which removes an application X on a regular basis. The starting point to access applications installed in a Windows machine is through retrieving them from a WMI ...
5
votes
3answers
6k views

Stripping lines from text file with Powershell

I am trying to remove specific lines from a text file. The text file is just a list and I want to remove specific entries if they are present. So what I have is this: $f=${path_to_file} for($i = 0; ...
1
vote
3answers
3k views

Execute a powershell script

I have a powershell script that I want to start when Windows 7 starts how can I do that?
0
votes
3answers
3k views

Export a list of installed features on a Windows 2008 server

I have been asked to specify the features which are installed on a production web server so a replica test environment can be created. I could point and click my way to the solution but I am curious ...
6
votes
1answer
6k views

Where can I download the SharePoint 2010 PowerShell Snap-in?

I just need a download link to the SharePoint 2010 Snap-In for PowerShell 2.0. All of my searches find instructions on how to use it, but not download it.
1
vote
2answers
872 views

Powershell ExecutionPolicy mysteriously resets

I am well versed in the ways of Set-ExecutionPolicy RemoteSigned etc. But for some reason, my machine resets the policy every so often. I have not been able to figure out the pattern, but every ...
3
votes
1answer
8k views

Powershell read and write file (Get-Content, Set-Content): How to use?

When I read a file into a variable $file = Get-Content myfile.utf8 and then write this same content into a new file Set-Content -Encoding utf8 mynewfile.txt $file Powershell automatically adds a ...
3
votes
3answers
3k views

Using ROBOCOPY to MOVE data around, not copy it

I have the following powershell script, which executes a few robocopy commands: ROBOCOPY.exe $q3 $q4 /R:5 /W:15 /S /NP /MT:32 /XA:SH /XJD ROBOCOPY.exe $q2 $q3 /R:5 /W:15 /S /NP /MT:32 /XA:SH /XJD ...
0
votes
1answer
3k views

With Powershell, how can I get the id of a process owned by a specific user?

Using Powershell, I want to do the equivalent of Unix ps -auxc | grep Emacs kill -9 364 (Assuming 365 was the pid the first command told me.) How do I do that? I find it incredibly hard to get ...
1
vote
2answers
323 views

Create new user, mailbox, and other stuf

I have a small active directory but want to be able to create and delete users from 1 point. I think powershell is a good way to do this. But is it possible to create a user, homedir, profile, ...
1
vote
2answers
136 views

Manage VMWare Server with PowerShell and Console App for Free

I just installed VMWare Server on Windows 2008 R2. This is the the free version of VMWare. Are there any management tools I can download and use (that are free) to manage the VM's or am I stuck with ...
1
vote
1answer
646 views

Creating home folders using Quest Active Roles cmdlets

I have created the following script to take data from a csv and create new users in AD: Import-Csv c:\newusers.csv | ForEach-Object -Process {New-QADUser -name $.'un' -ParentContainer ...
4
votes
2answers
475 views

powershell or bat - counting files in all directories and subdirec

we have a hardrive with hundreds of thousands of files i need to figure out how many of every file extension we have how can i do this with windowspowershell or command prompt or what ever else is ...