PowerShell is Microsoft's new scripting language in 2006, and significantly upgraded in 2009. It allows interpreted scripts based on PowerShell cmdlets and .NET primitives.

learn more… | top users | synonyms (1)

1
vote
1answer
205 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
29 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
409 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
147 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
134 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
489 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
165 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
343 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
70 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 ...
1
vote
0answers
755 views

RDS installation failure on 2012 R2 Server Core VM in Hyper-V Server

I'm currently installing a test-bed for my firms Infrastructure replacement. 10 or so Windows/Linux servers will be replaced by 2 physical servers running Hyper-V server. All services (DC, RDS, SQL) ...
1
vote
1answer
62 views

Powershell and DfsrConfigurationFromAD - how to check all servers are updated?

I have two Win2012R2 servers (SERVER1 and SERVER2) that uses DFS Replication for keeping a couple of folders synchronized. Using the following Powershell-script that i run on SERVER1 I disconnect it ...
4
votes
3answers
496 views

How can I create a windows shutdown script from powershell/command-line?

I've read the TechNet pages that describe using computer/user startup/shutdown scripts, and that's great, but I'd like to create those scripts via the command-line (and not have to click around in ...
-1
votes
3answers
707 views

How to change default install path for Notepad++ in Powershell silent/unattended script

I cant figure out the parameter(s) to change the default install path C:\Program Files\ of Notepad++ to the drive I want it to install to when I run my PowerShell script. I am trying to do a silent ...
18
votes
3answers
1k views

How do I delete this orphaned Active Directory computer object (preferably with PowerShell)?

I'm working from a Windows 7 workstation, with PowerShell v2.0, and trying to delete a particular (orphaned?) object from the LostAndFound container in a 2008 R2 FL forest and domain with the Active ...
11
votes
8answers
2k views

Expire Files In A Folder: Delete Files After x Days

I'm looking to make a "Drop Folder" in a windows shared drive that is accessible to everyone. I'd like files to be deleted automagically if they sit in the folder for more than X days. However, it ...
0
votes
1answer
84 views

Delete files except ones created on sundays with in last 4 weeks

I have a script that copies some files around and deletes older files from destination. right now it just deletes everything older than 10 days. to increase backup retention we need to keep files that ...
5
votes
4answers
203 views

powershell vs GPO for installation, configuration, maintenance

My question is about using powershell scripts to install, configure, update and maintain Windows 7 Pro/Ent workstations in a 2008R2 domain, versus using GPO/ADMX/msi. Here's the situation: Because ...
0
votes
1answer
118 views

Where can I get a list of KQL properties available in the Search-Mailbox -SearchQuery in exchange 2010?

Where can I get list of KQL properties available in the Search-Mailbox -SearchQuery Commandlet for Exchange 2010. A few I know of are subject:, body:, sentOn:, but I can't seem to find a ...
1
vote
1answer
464 views

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

I've tried re-installing 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 ...
2
votes
1answer
135 views

How to detect if there is any file added in a folder in Windows?

Is it a way to detect if there is any file added in a folder? Include the sub-folder. For example, check if any text file *.txt is added in folder c:\data-files\ or its sub-folders. The folder can ...
0
votes
2answers
236 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
86 views

finding guestid in offline documentation?

I have a little question thats been bugging me lately. I am using PowerCLI to create a new VM and I want to use the -guestId parameter to specify the Guest OS. Is there any built in documentation ...
2
votes
1answer
730 views

Powershell - Test user credentials in AD, with password reset

I can successfully use Powershell to tell if a user authenticates in Active Directory: Function Test-ADAuthentication { param($username,$password) (new-object directoryservices.directoryentry ...
3
votes
1answer
159 views

Configure Exchange to ignore requests for read receipts on certain mailbox

We have an Exchange (2010) mailbox that is automatically monitored by a windows service, this service connects to the mailbox periodically using Exchange Web Services 1.1 and imports the emails into ...
2
votes
1answer
56 views

How do -RetentionDays and -MaximumSize parameters work in Limit-EventLog in PowerShell?

I want to increase the size of the Windows Application Log using Powershell and intend to use Limit-EventLog. I must keep at least 7 days of logs and have plenty of disk space (at least up to the 4GB ...
2
votes
1answer
214 views

Can I use the GroupPolicy PowerShell module on non-AD standalone servers?

I am trying to use the GroupPolicy PowerShell module to manipulate and read local group policy settings on a standalone Windows 2012R2 server. When I try to execute the Get-GPOReport cmdlet: ...
0
votes
2answers
81 views

Can an encrypted credential be accessed from within a PSSession?

My local machine exists on a domain in a separate forest from the forest I administer. As a result, I use PSSessions extensively. While I have been able to encrypt my credentials and save them in my ...
1
vote
1answer
617 views

Comparing 2 CSV files in powershell exporting difference to another file

I've write this script out, and could have swore I had it giving me a Failed early this morning but now I'm getting nothing and not sure why. Basically I need to compare $SourceAddress with ...
0
votes
0answers
172 views

backup using powershell in windows 7 , 8

In windows 2008 we can use Add-PSSnapin windows.serverbackup abd use WBbackup command to back file and images. Both windows 7 and windows 8 have backup features; however there is no snapin to use ...
1
vote
1answer
182 views

Save Custom View from Event Viewer in .evtx

I have a Custom View in the Event Viewer with a couple of Event id's. I know you can save those event id's in an .evtx file to open it. This proces has to be executed manually. Now is my question, how ...
0
votes
0answers
143 views

Using Powershell (RSAT ) to get GPO from against another domain

I can't find any clear info online for what I'm trying to do, hope you can give me an answer :) I'm using a Windows 7 client (pctest) joint in a domain (domain1.intranet). I've installed the RSAT to ...
2
votes
1answer
525 views

server 2012r2: Cannot add-pssnapin windows.serverbackup

I am trying to run powershell script for backups on Server 2012 R2. I Have installed Windows server Backup feature but when try to execute Add-PsSnapin Windows.ServerBackup  I am getting error ...
1
vote
1answer
218 views

Powershell: using get-member to return object properties

I'm trying to browse all of the items in a sql server object. I'm working with a SQL server cluster and am using this code (lifted from another page) to get the values from 2 specific items. ...
3
votes
1answer
923 views

Script to export custom view Event Viewer to .evtx Powershell

This is my PowerShell script to export data from a Custom View in the Event Viewer via the XML data. set-executionpolicy unrestricted [xml]$CustomView = @" <QueryList> <Query Id="0" ...
3
votes
3answers
463 views

Adding remote machine to AD via Powershell

So I have a powershell script, Add-Computer -ComputerName $computername -LocalCredential $computername\admin -DomainName $domain -Credential domain\$username -Force -Restart So if I have a machine ...
2
votes
1answer
129 views

How can I create a VPN connection inside windows image?

Just like we can add driver packages to a windows image file can one add a vpn connection preferably thru Add-VpnConnection inside a .wim file ?
0
votes
2answers
133 views

Powershell pipe exporting to csv is loosing data

I'm trying to write a script that will take input from a .txt file of IP address. Do a reverse DNS lookup to get the hostname of the IP address and then export that data into .csv file. Here is what ...
0
votes
1answer
730 views

Strange behavior from Invoke-WebRequest in scheduled task

I'm running a PowerShell script that posts data to an internal webserver over HTTPS. The SSL certificate is not valid. I'm using [System.Net.ServicePointManager]::ServerCertificateValidationCallback ...
1
vote
1answer
148 views

Error 0x8007007e When trying to mount WinPE 5 wim in Windows 7 using Powershell

Using ADK for Windows 8.1, and the DISM cmdlets that come with them. I have WMF 4.0 installed. My machine is Windows 7 x64 SP1, and I'm trying to mount the wim using PS C:\Users\BigHomie> ...
0
votes
0answers
460 views

Parameterizing powershell parameters in scheduled tasks

I have a bunch of powershell scripts that are kicked off via scheduled tasks at various times. The script are run multiple times with different arguments. Also admins unfamiliar with scripting needed ...
4
votes
2answers
102 views

How can I assign IPv6 addresses based on existing IPv4 addresses?

I have several hundred Server 2008 R2 machines with static IPv4 addresses. I'd like to enable IPv6 on each interface, and then automatically assign IPv6 addresses to them based on their existing IPv4 ...
1
vote
1answer
127 views

How do I suppress “Yellow Text” from Exchange Set-Mailbox, when -WarningAction doesn't seem to work?

I am doing a bulk import, setting or updating attribute6 on 1,000 users in AD. I'm using the following Exchange commandlet to accomplish this: [PS] C:\>set-mailbox -Identity user@company.com ...
0
votes
1answer
84 views

MailboxExportRequest ContentFilter is “Received -ne $null” when querying by date

I am trying to export a mailbox to a PST. All email that was received before yesterday is what I am trying to export. $y = ((get-date).addDays(-1)).ToShortDateString() $exportRequest = ...
1
vote
1answer
66 views

Powershell runs all external commands in a new window, omitting output

As described in the subject, my powershell environment is executing all external commands in separate windows. In a typical test run of my team's build script, this includes things like: nuget.exe ...
1
vote
1answer
93 views

Difference between isntalling a msi using “Invoke-WmiMethod”(via a cmd file) and installing directly on the server

Ran against a server to install the msi; eventlogs were clean and all success; but the key file in bin direstory is still old. Later tried installing it directly doing a double click by RDP into the ...
5
votes
1answer
2k views

Powershell query lastlogondate (lastlogontimestamp) returning mostly blank values (not matching the ADSIedit value for corresponding user attribute)

I am running a very short script to simply print out all users and their last logon time: get-aduser -filter * -property * |ft name, lastlogondate I noticed only a small handful of users have a ...
5
votes
2answers
354 views

How to allow access to winrs for non-admin user?

I have Windows Server 2012 (and Server 2008, but it is next priority) to monitor it using txwinrm. txwinrm library internally is using WinRS protocol. I have to monitor it using least privileged user, ...
3
votes
2answers
411 views

Automatically reconfigure WinRM HTTPS listener with new certificate?

I am looking to enable WinRM HTTPS listeners on all of our servers for secure communication when using CredSSP between servers to get around the double-hop issue. Setting this up is fine, we have ...
6
votes
1answer
273 views

Evaluating current ACEs on NTFS ACLs with PowerShell

We have a document management system that has million of files on a NTFS file system accessed through a network share. A single service account needs full permission to all of these files and the ...
4
votes
6answers
507 views

Powershell assistance for Active Directory Cleanup

I just started a contract to clean up an Active Directory system for a large company. I was told it would be quite the busy work but after reviewing the system and seeing how disorganized and messy it ...