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
2answers
3k views

How can I move Exchange items to a PST using PowerShell?

We have a mailbox that receives status emails that we need to keep essentially for ever, and they contain potentially large attachments. I need to be able to move these messages to a PST on a regular ...
2
votes
2answers
6k views

How to create a forwarding account in office 365?

I'm migrating our emails from one hosted exchange provider to another. How can I create addresses that simply forward to another (external) address but don't have a mailbox of their own?
0
votes
2answers
2k views

Update content on an application with Powershell or WMI in Microsoft SCMM 2012 SP1

While right-clicking an applications deployment type(s), we can select Update Content. Is there a way of doing this action using Powershell or a WMI-method?
2
votes
1answer
2k views

Windows Server 2012 WBADMIN Documentation?

I'm trying to set up a script to run the backups of my Virtual Machines only using WBADMIN, I've got as fas as being able to backup all the VMs using the new -HyperV switch, however I also want to ...
3
votes
2answers
2k views

Powershell show users who are members of a group twice - once directly once indirectly

I have started setting up groups like: Department-staff Department-supervisors Department-director Where Department-supervisors is a member of Department-staff, and Department-director is a ...
1
vote
1answer
783 views

get-service using powershell does not return

If I send this two-liner to Powershell $sName = "ALG" $service = Get-Service -computername db-name -Name $sName I will get back information about that service on that computer. If I change the ...
1
vote
4answers
4k views

Mount NFS from PowerShell on Windows 2012 and be visible elsewhere

I'd like to mount an NFS share from Windows 2012 using PowerShell and have this mount be visible in contexts other than the PowerShell session that invoked it. If I use the New-PSDrive command ...
4
votes
3answers
314 views

Keeping Track of Enterprise Desktops [closed]

Part of my job is to make sure that for computers in a specific OU, whats Actually in use = whats listed in AD = whats listed in SCCM. This is for an environment with 250k PCs, but i specifically ...
0
votes
1answer
2k views

Remove AD User account with powershell fails

Am trying to delete a list of accounts that are either no longer needed or people who have left our employ. I was thinking powershell would be the easiest and so far have the following script to ...
2
votes
2answers
5k views

How can I reset settings for Internet Explorer using a script?

I'm looking to reset Internet Explorer back to factory defaults using a batch file. I'd also like to delete: all Downloads, History, Cookies and Cache, plus anything else in a user's IE profile.
5
votes
2answers
2k views

Is it possible to list all permissions where I don't have access

I'm looking for a way to recursively go through my entire file share ( fairly large 3TB of files ) and list out all files/folders that I don't have access to. Due to a migration and some errors on ...
2
votes
1answer
263 views

Remote disk monitoring with WMI without admin rights

I am setting up a restricted WMI group that should be able to read WMI information from my remote hosts. I have the group set up as member of the remote DCOM and performance monitor groups. I also ...
1
vote
2answers
745 views

PowerShell filter files by date in name

I have many files with different names per day. How can I filter them by the date in their name? For example: app_20130505.log app_20130506.log app_20130507.log app_20130508.log app_20130509.log ...
1
vote
1answer
468 views

Invalid namespace “rootvirtualization” on Hyper-V 2012

Running the following command on a fresh Hyper-V 2012 server: get-wmiobject -namespace “rootvirtualization” -Query “select * from Msvm_ConcreteJob” produces this errorerror: Get-WmiObject : ...
1
vote
1answer
602 views

Exchange OWA 2010 signature policy

I have an Exchange 2010 environment. For Outlook (desktop version) we have a script setup in Group Policy to push out standardized signatures across the organization. I want to do the same for OWA, ...
4
votes
4answers
5k views

Windows Server 2008 R2 PowerShell script runs manually, but not as a scheduled task

I have a PowerShell script that runs manually using the PowerShell ISE. However, when run as a scheduled task using an administrator's credentials the task does not run with the expected results. The ...
2
votes
2answers
779 views

PowerShell to reset local Administrator account password. 5% failures

I have the responsibility for changing the local administrator account password on my environment of 16,000 servers; I wrote a PowerShell script, but it took too long, so I added multi-threading using ...
0
votes
1answer
1k views

How do I set msExchMailboxGUID using powershell or any other method?

I need to set the msExchMailboxGUID for many accounts in bulk. My input for this data comes from the Powershell command Get-MailboxStatistics. In it is an object that has the GUID for the mailbox. ...
1
vote
0answers
1k views

Powershell Script Hard drive Inventory

I've created a script to get hard drive information from our servers. The script use WMI to query the Win32_LogicalDisk class and returns "Size (GB)", "Free Space (GB)" and "Free Space (%)" for each ...
0
votes
0answers
301 views

Why is Last Windows Update date not set in Registry when Updating via COMObject?

When i manually Update a Windows Machine (W2K3) via the yellow icon in the Taskbar, i can get the last Install date via the Registry: (Get-ItemProperty -Path ...
4
votes
1answer
749 views

How to get Mailbox Folder Permissions with SamAccountName or UPN?

I need to collect and store the folder permissions for each folder in each mailbox of our Exchange system. I'm already aware of the Cmdlet Get-MailboxFolderPermission but it has a serious problem. ...
2
votes
2answers
2k views

How to pipe an object in the powershell correctly to avoid “Expressions are only allowed as the first element of a pipeline” error

Is there any way to do the following without creating the object $obj? $obj = New-Object System.Security.Principal.NTAccount("Students") ; ...
0
votes
1answer
340 views

Powershell “ExpandProperty” doesn't work when saving to CSV output

How do I expand the $thisPerms = Get-Mailbox username -ResultSize unlimited Get-ADPermission $thisPerms.Identity | Where {$_.ExtendedRights -like "Send-As" -and $_.User.ToString() ...
1
vote
2answers
292 views

Can I install the Exchange Management Shell on a workstation in a different forest?

At work, we have two forests with a two-way transitive trust between them. I need access to the Exchange management shell for an Exchange environment that resides in a different forest than my ...
1
vote
1answer
522 views

How can I filter a Dynamic Distribution Group by Database name?

I need to create a dynamic DL to list the members of an individual database and I'm unable to get the powershell command to filter the results properly. [PS] C:\>New-DynamicDistributionGroup -Name ...
2
votes
1answer
2k views

Exchange: exporting and deleting items

How would I safely export data from Exchange 2010 mailboxes to PSTs using New-MailboxExportRequest and have the exported items deleted from the source mailbox? The Powershell cmdlet seems to be ...
2
votes
1answer
404 views

Reauthenticate a Remote Connection via PowerShell Script

I have a PowerShell v1 script that connects to a remote server via UNC path. After a reboot, authentication is needed because Windows apparently will not remember so the script cannot connect to the ...
1
vote
1answer
788 views

Resetting the VMware PowerCLI global:DefaultVIServer and global:DefaultVIServers system variables?

Can anyone here please assist me in resetting the global:DefaultVIServer and global:DefaultVIServers system variables into $null ? because I cannot do anything with my PowerShell anymore even after ...
2
votes
2answers
1k views

How do I “catch” a failed command that doesn't work with try…catch?

I'm running the following script that fails for a mailbox that doesn't exist Set-MailboxDatabase rdb16 -AllowFileRestore:$true Mount-Database rdb16 $stats = Get-MailboxStatistics -Database rdb16 ...
0
votes
1answer
381 views

Reconnecting to a Mapped Drive after Server Restart from within PowerShell Script

I have a PowerShell v1 script that connects to a remote server via a mapped drive and moves files back and forth the remote server is identified by drive number "M" and also by UNC path ...
0
votes
1answer
294 views

AppFabric 1.1 on Server 2012 Dashboard Powershell - PSCustomObject

I have installed AppFabric onto Windows Server 2012. I checked the prerequisites were installed first and have installed accumulative update 3. I have an instance of SQL Server 2012 installed to SP1 ...
0
votes
1answer
571 views

Restart a service, and its dependents remotely in Windows

Normally after running Windows updates there are a few servers in our infrastructure that our monitoring software (SolarWinds) shows as having problems. Normally this is flagged as being the netman ...
0
votes
1answer
164 views

How to get process not responding on remote server with Powershell

I don't understand, responding is empty on remote serveur. Get-Process explorer -ComputerName vcass1 | select name,id,responding Name Id Responding ---- ...
1
vote
1answer
599 views

PowerShell - Combining Sort-Object to list of piped commands

I need to process files in order from oldest create date to newest. I found the sort-object command which is what I need however I don't have a clue how to add it to my ForEach() statement. Can ...
2
votes
1answer
3k views

PowerShell PSCredential Argument List - Path

I need to connect to a remote server and do some file copies and moves, etc. The remote server requires authentication. What do I need to enter in for PSCredential -ArgumentList, argument #1? Is it ...
2
votes
1answer
323 views

Is there a cmd/certutils to copy a certificate from one store to another?

I would like to know if there is a cmd to copy an existing certificate from one store to another. I am trying to copy a certificate from the Users Intermediate Certification Authorities store ...
1
vote
2answers
307 views

PowerShell v1 Move-Item not Moving items

I have a script (pasted below) that's supposed to do the following: Loops and grabs all files that match a defined pattern Copies those files into another location Move the original source file into ...
1
vote
1answer
544 views

PowerShell Copy-Item Method Fails

I am trying to use PowerShell (v.1) to copy over only files that match a pattern. The file naming convention is: Daily_Reviews[0001-0871].journal Daily_Reviews[1002-9887].journal [...] When I run ...
1
vote
2answers
134 views

Pattern Matching with PowerShell 1

All, I am new to Windows admin-type stuff but I am familiar with Unix/Linux, etc. I have a simple PowerShell 1 script that should only copy files that match this naming convention: ...
2
votes
2answers
6k views

Using Powershell to bulk change the Home folder path of AD objects - %username"?

I have done a lot of searching on this, and still cannot find the answer. I have created a script which will bulk move all user objects in one OU to another OU. This works fine. Now I am trying to ...
2
votes
1answer
2k views

Powershell: Understanding Printer DACLs

I'm attempting to read and eventually write the DACLs for printers shared from my print server. Here's what I have so far, based on scripts found around the internet: $pace = DATA { ...
4
votes
1answer
3k views

How do I run commands on a remote machine with admin privilege using powershell

How do I run commands on a remote machine with admin privilege (example: running as Run as Administrator) using PowerShell. So far I have tried start-process powershell.exe -verb runas ...
5
votes
2answers
2k views

Changing physical path on IIS through appcmd isn't activated

We have come across an issue on IIS 7.5 where we have a simple deploy system which consists of the following: Create a zip-file of new webroot, consisting of three folders: Api Site Manager This ...
1
vote
1answer
2k views

The value of property “UserPrincipalName” is used by another recipient object

I'm stuck in some sort of strange loop. I tried to create an office 365 user, and did not have any available licenses. I followed the link to purchase an additional license, then went back and ...
2
votes
1answer
38 views

Alternative for Obsolete -VhdDestinationPath Parameter

I am trying to import a virtual machine with PowerShell and I want to specify which folder the VHD file should be placed in. According to http://technet.microsoft.com/en-us/library/hh848495.aspx the ...
-1
votes
1answer
205 views

Some regex for powershell [closed]

I have below sample file(s). Symmetrix logical device count=13 CLARiiON logical device count=0 Invista logical device count=0 Generic logical device count=0 ...
0
votes
0answers
410 views

PowerShell doesn't like the -AssignDriveLetter option of the New-Partition cmdlet

I'm trying to create a partition on the USB flash drive using the New-Partition cmdlet. But when I use the -AssignDriveLetter option I get "New-Partition : Invalid Parameter" even though this option ...
1
vote
0answers
435 views

Cannot create partition on disk using PowerShell: “New-Partition : Not enough available capacity”

I'm trying to create two partition on the USB flash drive. The first small 350Mb partition is created fine, but the second throws "New-Partition : Not enough available capacity" even though there is a ...
1
vote
0answers
397 views

Cannot initialize disk in PowerShell : Initialize-Disk throws “The disk has already been initialized”

I'm trying to change the flash drive's partition style to GPT using PowerShell, but the cmdlet throws "The disk has already been initialized" (even though I've cleaned the drive): PS ...
3
votes
3answers
2k views

Export Windows Server configuration to powershell script?

I'm looking for a way to export role/feature configuration to a scriptfile, like powershell. Lets say you've installed the DHCP-Role. You configure the scopes, reservations and all that stuff you ...