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
2answers
1k 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 | ...
2
votes
3answers
938 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) { ...
1
vote
1answer
23 views

Active Directory Module for PowerShell Get-ADObject and Set-ADObject don't work with custom attribute

I am trying to work with a custom attribute in an AD LDS instance that I did not create, using the Active Directory Module for PowerShell. Unfortunately, the cmdlets Get-ADObject and Set-ADObject are ...
3
votes
1answer
23 views

PowerShell AD LDS query with filter using wildcard not behaving as expected

I am the administrator for a learning management system website that stores its page structure in AD LDS. I am trying to run a query to get objects (pages on the site) matching a filter for ...
2
votes
1answer
21 views

Adding Folder Permissions Using Powershell

I'm running this script in PowerShell: Add-NTFSAccess -Path 'C:\MyFolder' -Account PROGRAMMING\IIS_IUSRS -AccessRights FullControl and I'm getting this error: Add-NTFSAccess : Cannot bind ...
-1
votes
0answers
15 views

need a script to add users under a different domain to shares [on hold]

Many users are now logging in under a different domain and cannot access the shares because they only have permission under the old domain. I need to add the same usernames with the same permissions ...
1
vote
1answer
25 views

Deploy a Powershell script and run on shutdown thru group policy

I have a Powershell script I need to deploy to my clients PC and then run it on shutdown. I̶ ̶k̶n̶o̶w̶ ̶i̶t̶ ̶i̶s̶ ̶p̶o̶s̶s̶i̶b̶l̶e̶ ̶t̶o̶ ̶r̶u̶n̶ ̶P̶o̶w̶e̶r̶s̶h̶e̶l̶l̶ ̶s̶c̶r̶i̶p̶t̶s̶ ̶o̶n̶ ...
1
vote
0answers
138 views

Can not install Office 2010 via winrm

I am trying to install Microsoft Office 2010, I have created a MSP and config.xml file so I can do this from Powershell, using the following command: Start-Process "C:\temp\Office2010\x86\setup.exe" ...
1
vote
1answer
12 views

Powershell: kill one window of a subset running under one process?

Using powershell can I kill/force close a single window (excel workbook) running under Excel without killing the whole process which closes all excel workbooks running under that same process ...
3
votes
2answers
7k views

How to select a user and remove all groups they are a member of using Powershell (with Quest)?

I've read quite a bit online about this and thought I had found a solution, but it doesn't seem to be working like I would expect. I am wanting to get a user based on the username I input, then ...
1
vote
1answer
628 views

Certreq -retrieve can't find the specified CA

I'm currently writing a Powershell script and have run into a bit of a roadblock. Basically, the script requests, approves, and retrieves new certificates from our CA using certreq.exe and ...
0
votes
0answers
9 views

Scheduled tasks not working depending on context

I'm trying to run a PowerShell command for a persistent session in Metasploit. It downloads and executes shellcode on system startup. I've gotten it to work when I'm on the computer with the GUI, ...
0
votes
2answers
250 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: ...
0
votes
2answers
1k views

KQL Query to specify date range for Mailbox search?

I'm trying to verify some phone numbers using our exchange server with the following query to send the results to my inbox: Get-Mailbox | Search-Mailbox -SearchQuery “Body: '*XXX-XXX-XXXX*' OR ...
0
votes
1answer
18 views

PowerShell DSC Pull Server with digitally signed module - ErrorDetail is The PS <path to module> is either missing or its associated MOF schema

I've configured a test DSC pull server and I'm attempting to use a digitally signed xPowerShellExecutionPolicy file but I am constantly getting an error stating that the MOF schema file is invalid or ...
0
votes
2answers
40 views

Find the latest string based on time and display those

I have a text file as shown below: testdatabase-21-07-15-12-00 testdatabase-21-07-15-18-00 testdatabase-21-07-15-23-00 testdatabase-22-07-15-12-00 testdatabase-22-07-15-18-00 ...
-3
votes
0answers
27 views

Script to know the status of user accounts created, modified and deleted [on hold]

Script to know the status of user accounts created, modified and deleted on windows 2012 server active directory. If the script could send me an email notification by the end of every day that would ...
1
vote
1answer
30 views

How to cast as ArrayList AND preset data in param block?

As I need to be able to add and remove items from an array I need to cast it as an ArrayList as opposed to the more common options ([string[]], [Array], $Var=@()). I also need to preset it with data, ...
1
vote
1answer
15 views

Poweshell escaped wildcard

I'm trying to compare string which contains wildcard character. ("www.mysite.*" -match '`*') But something is not working because I always get a True response, for example ("www.mysite.com" ...
1
vote
1answer
3k views

SQL PowerShell Snapin Problems

I am hoping this is an easy fix and oversight on my part. I need to be able to run the SQL cmdlets from remote machines. I have installed Microsoft® Windows PowerShell Extensions for SQL Server® 2008 ...
0
votes
2answers
90 views

Bulk Update AD Attribues with Employee ID as matched key

I have a CSV file that I need to bulk update AD with. The file has an employeeID, which would match the employeeID field in AD. So far, I've been able to update a user successfully with a CSV file if ...
3
votes
1answer
1k views

Exchange's New-MailboxExportRequest behaves strangely with DateTime parameters to ContentFilter

I am attempting to extract a certain date-range of emails from a mailbox into a PST, but using a DateTime parameter for ContentFilter doesn't seem to work as expected. This should export everything ...
12
votes
4answers
30k views

Gaining administrator privileges in PowerShell

I only have one account on my Windows Vista machine, and that user has administrative privileges. However, when I try to execute a command within PowerShell to kill a certain process, I'm greeted with ...
0
votes
1answer
1k 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 ...
5
votes
1answer
3k views

Batch script is not getting executed when called by Start-Process Cmdlet

I have a strange issue on a Windows Server 2012 R2 here that just does not make any sense to me at all. I've got a PowerShell script that basically has the following structure: Function ...
6
votes
2answers
4k views

Add a binding to an IIS site using powershell

I'm trying to control bindings in an IIS app using powershell. I'd like to create a site with both a http and https binding using a script. This is what I have thus far: Param( ...
1
vote
2answers
1k 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:\> ...
1
vote
1answer
1k views

How can I get the number of users actively using Lync?

How can I report on the number of users actively using Lync in my organisation? I want to be able to find out what the uptake is. Thought about going through our mail server, but the saved ...
1
vote
1answer
26 views

Powershell script get .NET Framework versions from remote PCs

I have the following script. Get-Content comps.csv | Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | Get-ItemProperty -name Version,Release -EA 0 | Where { $_.PSChildName ...
0
votes
1answer
2k 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 -> ...
-2
votes
0answers
13 views

removing persmisions in hard drivers using powershell in AD

I am trying to remove groups in hard disks in all Servers in AD (EVERYONE and USERS) I can create a batch or policy but I heard using powershell is faster and better, I have no much experience with ...
0
votes
1answer
19 views

Mass forward usermailbox emails to mailcontacts with same name. Need powershell command to do so

I have 2 OU's of users that each have a mail contact with the same name in a seperate single OU. So Jane Doe would be in Staff\OU1 with jdoe@contoso.com email. Mike Doe would be in Staff\OU2 with ...
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
1answer
28 views

How do I find IIS web application dependencies using powershell and webadministration on Server 2012

Wondering if someone can help with this. I have a number of servers that host IIS 7.5 and IIS 8.5 web application of various types. As these are production web applications and servers i can't ...
3
votes
1answer
590 views

Powershell and NMAP Information Sharing

I am working on a project where I would like to perform host documentation for a variety of items. Part of these items would be sourced from Powershell and the rest would be sourced from NMAP. For ...
0
votes
3answers
69 views

Powershell Querying Code

I am having issues writing some PowerShell code. I am trying to run a query against Active Directory which will export all groups, members of the groups, email addresses, and SIDs of each user to a ...
0
votes
1answer
30 views

Copy-item with multiple filter

How can I use copy with multiple filter values? For example, it works if I specify only 1 value to filter (*.jpg) Copy-Item -Path Y:\TEST -Recurse -Filter *.jpg -Destination ...
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 ...
0
votes
0answers
31 views

NTFS Traverse-permission - How are the correct settings?

I am trying to get the traverse-permission to work, but I just can't handle it. I have read a lot of threads (at serverfault and some other places) but still... What I want to do is the following: ...
1
vote
2answers
1k views

Powershell - winrm using ip address instead of computer name

Is it possible to set up winrm using IP address instead of the computer name. The computer in question is only I have only been able to set winrm up for a computer in the same domain like this: ...
1
vote
1answer
2k views

How to start SMTP [SMTP Virtual Server #1] through powershell or command prompt

Because of some error on my server my SMTP [SMTP Virtual Server #1] stop. I wanted to create job which will run periodic timely and check the SMTP server status, If its stop then it will start it ...
0
votes
2answers
1k 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 = ...
0
votes
1answer
22 views

Access is Denied for PowerShell access site via URL in localhost

What IP I need o put in the IP Address and Domain Restriction in order to allow Windows PowerShell to be able to run Invoke-WebRequest to a URL for a site that is hosted on the same machine. I am ...
0
votes
1answer
17 views

Is there an Exchange Powershell command that allows events to be added to room resources in OWA?

We have an onsite Exchange server, we have a room resource that has been created and is opened as an other calendar in Outlook. When using Outlook 2007 we can add an event to the resource. When we log ...
1
vote
1answer
19 views

Copy Folder from Structure to new location

I have a structure of 900 users like below User 1 Personal personal.pst I need to copy the Personal folder from each user folder to a new structure such as below User 1 (diff username) ...
1
vote
2answers
35 views

Check backpressure live on Exchange2010 server

I am working a lot with exchange servers at the moment and would like to make sure there is no backpressure built up on them. Right know I have a powershell script running every 4h to check the ...
0
votes
1answer
1k views

How to export Exchange public folder permissions and import them to a different system?

I'm involved in a migration from Exchange 2010 to Office 365 (Exchange 2013); all user mailboxes have already been successfully migrated, but due to some glitch or bug that even Microsoft's support ...
1
vote
3answers
9k 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 {& ...
0
votes
1answer
32 views

Windows Server 2012 R2 The route addition failed: The system cannot find the file specified

I am using a simple powershell command,(ran as Admin) as follows. route –p add 172.30.200.0 mask 255.255.255.0 0.0.0.0 IF 28 I have done this no problem on Windows 8.1, but when I do this in ...
2
votes
1answer
1k views

Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps'

I've tried reinstalling SQL Server 2014 and I'm still getting the following error message when trying to import-module sqlps. The same registry key exists, but is appended with 120. I'm able to use ...