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

Using Powershell's Invoke-command to install .exe on remote computer

I have an .exe I would like to install on a large farm of Windows Server 2008 computers. I am attempting to use Powershell remoting. I have this command which works locally: invoke-command {& "...
1
vote
1answer
92 views

Dynamics CRM: Get-CrmSetting SSL/TLS error

I am getting an error when trying to enable Tracing in one of our servers. Commands used: Add-PSSnapin Microsoft.Crm.PowerShell Get-CrmSetting TraceSettings Error: Get-CrmSetting : The ...
-1
votes
1answer
15 views

Get Error, Success Logs On powershell script Importing Bulk AD user

This Script will the best Bulk AD user creation script for me, if I am able to Generate success and error logs. This script just requires FirstName and Lastname on Csv that cut offs few minutes. ...
1
vote
1answer
42 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 ...
0
votes
2answers
30 views

Powershell - how can i list both username and group membership for users of a named group?

I am relatively new to powershell and I have two statements on the cmd line: get-adgroupmember <group name> | select-object name,samaccountname To produce a nicely formatted table with two ...
0
votes
1answer
21 views

ContentFilter is invalid. System.Datetime

If i run the following $3MonthsBack = Get-Date (Get-Date).AddMonths(-3) -f MM/dd/yyyy New-MailboxExportRequest -mailbox kundesenter@company.no -IncludeFolders akriv -ContentFilter{Received -lt "$...
0
votes
2answers
2k views

PowerShell script can't open a file when run as a scheduled task

My PowerShell (2.0) script has the following code snippet: $fileName = "c:\reports\1.xlsx" $xl = new-object -comobject excel.application $xlFormat = [Microsoft.Office.Interop.excel.XlFileFormat]::...
-1
votes
0answers
11 views

InetMgr.exe throw System.Management.Automation.CmdletInvocationException

I fired up my Windows 7 machine today and attempting to start Intemgr.exe the process terminates immediately. So I started the process under the debugger. It seems the process is terminating with the ...
13
votes
7answers
36k views

How to determine 32 or 64 bit version of Windows Server 2008 using Powershell?

Using the Powershell console, what command/commands can be executed to determine if the 32 or 64 bit bersion of Windows Server 2008 is installed?
2
votes
1answer
2k views

Identifying mailboxes with corruption Exchange 2013

We're preparing to rid ourselves of Exchange on-premise and are migrating from an outsourced hosting provider to go to Office 365. We're running a fully patched version of Exchange 2013, atop Server ...
2
votes
2answers
8k views

Powershell: Single Script to “clean” multiple folders of files older than

I would like to create a maintenance script that would run on each of our servers to clean out common drop/archive directories. Preferably the script would use a reference file for the folder path ...
8
votes
3answers
81k views

List All Groups and Their Members with PowerShell on Win2008r2

I am new to powershell, but I've been reading manuals and practiced a little bit. My objective is to List all users in all Security Groups under specified path. I have found the way to do it: get-...
0
votes
2answers
51 views

Obtain a list of servers from AD on which a specific software is installed?

Is it possible to obtain a list of servers from within Active Directory on which a specific software is installed? For example, get all servers that have wampserver version 5 installed on them.
0
votes
2answers
78 views

Find Computer in AD from non-joined Windows 7

I have a powershell script we use for several things, when a new computer has been installed with Windows 7. We also use it on Windows 10, and it all works well. It runs at first login and the ...
1
vote
1answer
44 views

Powershell change AD variable “PasswordLastSet”

Is it possible to edit the PasswordLastSet value via powershell (or any method?)? If that is not possible, is there anyway i can set so a users password (not account) expires in X amount of days. I ...
1
vote
1answer
23 views

PowerShell - Find out Who has Read permissions on a Network Folder Share

In a Windows Server & Active Directory environment, where a particular network-share is shared with only certain AD users/groups. Is there a way, using PowerShell, to find out who has read ...
0
votes
1answer
4k views

Automatic alert/notification of calendar items added to Public Folders

We currently use Public Folders with Exchange 2010. We have a series of shared calendars throughout the organization. Some of the items posted require us to set up devices (video conferencing for ...
0
votes
0answers
21 views

powershell - retrieve certificate information on remote computer [closed]

Please help... I'm trying to get the below script to work. I'm new to powershell world and I appreciate anyone who can help me fix this. $RemoteServerList = "Server1","Server2" $RemoteWebCertList = ...
-1
votes
0answers
20 views

How can I tell if there is a prepared SQL Server install on a machine using PowerShell?

How can I check in PowerShell if the SQL Server install on a machine is just a prepared install (done before a sysprep) or a full ready to go instance?
0
votes
1answer
20 views

Running Net Stop unelevated

First of all, this is one of those borderline questions between serverfault and superuser. In the end, I decided it belonged here because of the fact that most aspects of it revolve around a domain ...
1
vote
1answer
34 views

Writing a script to find what computer a user is logged into

So I want to specify a username and return the computer name. When I run this, it tells me that my $computers obj is null. Why would $computers = Get-ADComputer | where {$_.accountdisabled -eq $false}...
0
votes
2answers
38 views

Need ideas for ScheduledTask to copy file from CompA to CompB

So, I'm fairly locked down in my environment, but maybe there's still a way I haven't thought of to get this done... Need to have a flat file copied from Computer A to Computer B preferably by ...
5
votes
1answer
2k views

Why am I getting unauthorized errors with Powershell get-winevent?

I'm a domain admin equivalent, I've tried running in an elevated console (right-click> run as administrator), and I'm consistently getting errors when executing get-winevent -logname application | ...
0
votes
1answer
248 views

Is there any outlook.exe /resetfolders equivalent that can be executed against all Exchange mailboxes?

Outlook can "Restore missing folders for the default delivery location" if ran with a switch "outlook.exe /resetfolders". This is good for just one or two mailboxes. What can I do if I need to do this ...
-2
votes
0answers
19 views

Workstation in domain has PowerShell | No GP to disable

I am running Windows Server 2012 and I currently have 1 workstation Windows 7. It has powershell automatically installed with windows 7, I want to disable this throught group policy but I am unable to ...
1
vote
2answers
2k views

Importing NTFSSecurity module from UNC path fails

I've created a central repository for Powershell modules, but I'm having trouble loading one in particular. The NTFSSecurity module is failing to import with the following message. PS Z:\> Import-...
7
votes
3answers
33k views

Writing a powershell script to copy files with certain extension from one folder to another

I would like to write a powershell script that gets the following parameters as input: Folder to copy from, extensions allows, folder to copy to and a boolean indicating if the change should restart ...
1
vote
1answer
34 views

Granting a user permissions to PS Remote without allowing RDP

Is there a way I can grant a user the ability to use Invoke-Command in PowerShell remotely without giving them RDP Access to the server?
1
vote
2answers
1k 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 ...
2
votes
0answers
23 views

How can one update BGP ASN on an Azure Virtual Network Gateway?

I have an existing Azure Virtual Network Gateway I'm attempting to reconfigure for use for BGP, per https://azure.microsoft.com/en-us/documentation/articles/vpn-gateway-bgp-resource-manager-ps/ . ...
16
votes
7answers
22k views

Force-remove files and directories in PowerShell fails sometimes, but not always

I am trying to delete a directory recursively with rm -Force -Recurse somedirectory, I get several "The directory is not empty" errors. If I retry the same command, it succeeds. Example: PS I:\...
0
votes
3answers
58 views

How to SSH to all instances in EC2 cluster?

I just created a cluster using spark-ec2. I followed steps here http://spark.apache.org/docs/latest/ec2-scripts.html . Now I want to configure all slaves (150), i.e., install Java 8 for both master ...
8
votes
2answers
320 views

Powershell's equivalent to Bash's process substitution

Bash has <(..) for process substitution. What is Powershell's equivalent? I know there is $(...), but it returns a string, while <(..) returns a file the outer command can read from, which is ...
-1
votes
1answer
70 views

Get AD users who have not logged in the past x Days and are member of a specific group?

I'm sorry if this looks like a duplicate. Actually the same question has been asked under http://serverfault.com/questions/783399/get-a-list-of-users-who-are-domain-admins-and-have-not-logged-in-the-...
2
votes
2answers
10k views

When ran as a scheduled task, cannot save an Excel workbook when using Excel.Application COM object in PowerShell

I'm having an issue where I've automated creating an Excel.Application COM object, add some data into a workbook, and then saving the document as an xlsx. This works fine if: I'm already in ...
1
vote
2answers
117 views

Get a list of users who are Domain Admins and have not logged in the past 30 days?

How can I get a list of users from AD who are Domain Admins and have not logged in the past 30 days?
1
vote
1answer
76 views

How to copy a file to network resources using UNC paths

I'm trying to do something pretty simple, and conceptually it should work, but it doesn't seem to, and I'm not sure why. I have a file I need to copy to multiple folders on multiple servers. I've been ...
2
votes
1answer
3k views

PathTooLongException error when using Get-ChildItem

I'm trying to generate a list of all known file on a file share with Attributes "Archive + Offline". But I keep running into PathTooLongException errors. So far I've only found that Robocopy can work ...
0
votes
1answer
2k views

Powershell execution policy within SQL Server

Can anyone help? Firstly I apologise if this is the wrong forum and for the amount of text you have to read. I'm not allowed to post images yet and a picture is worth a thousand words..... When ...
17
votes
4answers
23k views

Managing Windows Powershell from Linux terminal

I manage Windows Server 2012 servers. I'm learning PowerShell to manage these servers through command line. My workstation runs Ubuntu and I usually manage Linux servers by connecting via SSH. Is ...
3
votes
1answer
62 views

How to combine properties in Powershell from multiple Objects

Many times I've needed to combine data that can only be retrieved from two separate powershell CMDLETs into a single dataset for export. I believe this should be do-able by creating a PSObject and ...
1
vote
1answer
88 views

Why is Get-DPMDatasource not recognised in Powershell? (Using DPM Module)

I am using Import-Module DataProtectionManager To have access to DPM cmdlets in powershell. (DPM Version 2012R2) Unfortunately, Get-DPMDatasource is stating it is an unrecognised cmdlet. Without ...
1
vote
2answers
57 views

Start Process as normal user powershell

I'm creating a powershell script that does some automatic setup of new computer deployments. I'm in a situation where I want to launch an executable as a regular non-admin user from an elevated admin ...
0
votes
1answer
3k views

How to save event logs “Network Policy and Access Services” on NPS server

We have a Windows Server 2008 R2 Enterprise server with NPS role installed in it. (We dont use NAP). Is there any way, we can save all the event logs in------ Event Viewer -> Custom Views -> ...
0
votes
2answers
31 views

Moving all folders with only a single item inside

I have found a powershell function, which virtually does what I need, but not quite... I want to find all child folders within a parent that ONLY have one file inside. I have found some code which ...
2
votes
3answers
3k views

Powershell Start-process -Argument list not working

Start-Transcript c:\scripts\InstallUpdates.log -Append # -NoClobber $SourceMSUFiles = (get-content install-list.txt | where {$_ -like "*.msu"}) #Install MSU files foreach($file in $SourceMSUFiles) { ...
10
votes
4answers
8k views

What are Runspaces in Windows PowerShell 2.0?

Today I listened to a HanselMinutes podcast about PowerShell 2.0. Scott Hanselman interviewed Hal Rottenberg and Kirk Munro at TechEd 2009. They talked about RunSpaces in PowerShell 2.0. Can somebody ...
1
vote
2answers
233 views

PowerShell persistent connection during remoting

I'm having a hard time understanding persistent connections in PowerShell during remoting sessions. I created my persistent connection and created a variable to test its lifespan: $session = new-...
13
votes
5answers
29k views

How to properly add .NET assemblies to Powershell session?

I have a .NET assembly (a dll) which is an API to backup software we use here. It contains some properties and methods I would like to take advantage of in my Powershell script(s). However, I am ...
0
votes
2answers
1k views

“Maximum number of items that can be serialized or deserialized in an object graph” when executing GetMsolUser -All

I have an office 365 tenant on which I execute the following command Get-MsolUser -All on server A I get get-msoluser : The formatter threw an exception while trying to deserialize the message: ...