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)

0
votes
2answers
2k views

Run PowerShell script within a maintenance plan

I have an SQL Server 2008 database, run on a 64-bit Windows Server 2008. I created a pretty simple PowerShell script that automates a bunch of tasks. I would like this script to run as part of our ...
0
votes
3answers
932 views

Enable-PSRemoting on Windows Server 2008 R2 error

When giving the command Enable-PSSRemoting with or without the -Force parameter this error occurs Set-WSManQuickConfig : More data is available. At line:50 char:33 + Set-WSManQuickConfig ...
-1
votes
2answers
5k views

How To List All Computers Operating System On A Network In Powershell

I am looking for a script to show all the machines, hostnames, and OS versions on my domain. I have found a few scripts, but none of the scripts that I have found will do both. Here is an example of ...
0
votes
2answers
45 views

Generate List of IP's With User Names On Windows Network

We recently setup GFI WebMonitor on our network which is giving me back IP's instead of User's. I'm in the process of determining whether we will be able to implement authentication on the proxy to ...
1
vote
2answers
45 views

Set NTP server on all AD members (old and newly connected) using w32tm or PowerShell?

I am looking for a PowerShell script that I run one time only on the DC. I found w32tm but I don't know how to use it. Thanks in advance!
2
votes
2answers
4k views

Powershell script to delete sub folders and files if creation date is >7 days but maintain parent folders of sub folders and files <7 days old

I'm currently using the Powershell script below to delete all files directories and sub directories of "$dump_path" that are seven days or older based upon the creation date and not modified date. ...
-2
votes
0answers
14 views

Script for allow IP Range in Window Server 2008 R2 [on hold]

I want to Allow a Specific Range Of IP Address of My Server But IP Range is very Large, So i want write a Script For This.. Please Any One Give Me a Specific Script for Allow This.
3
votes
1answer
107 views

Can vSphere PowerCLI cmdlets execute from a PS1 file?

I'm looking to write an admin script that will: Delete a VM from vSphere Delete the VM's DNS entry Release the VM's IP address with our Windows DHCP server I can accomplish the first item via ...
1
vote
1answer
45 views

Setting HomePath to EmployeeNumber as a variable

We are planning to use the EmployeeNumber user attribute in AD to create the path to each user's Home drive. Reason for this is that AD user names are currently based on last name, which changes often ...
4
votes
2answers
136 views

Install - Import PFX Certificate to separate local account's Personal store - Automated

I've been wrapping my head around automating a way to perform this task: We deploy Windows Server 2008 R2 images for our customers. We use PowerShell (version 2) to deploy our proprietary software ...
1
vote
1answer
489 views

Use PowerShell to edit a remote file on a Windows 2008 Server

Editing a file on a remote linux server via SSH and vim is something I usually do on a regular basis. Recently, I got on a new web project involving Microsoft technologies instead of the usual open ...
9
votes
1answer
3k views

Unzip File With Powershell in Server 2012 Core

I need to unzip a file with powershell. The typical way I've seen everyone do this is by automating the shell with a script. $shellApplication = new-object -com shell.application $zipPackage = ...
0
votes
0answers
7 views

How to perform basic arithmetic in Powershell? [migrated]

$excel_test = New-Object -ComObject Excel.Application $excel_test.visible =$true $excel_test.DisplayAlerts =$true $excel_test.Workbooks.Add("C:\Users\Lab-User\Documents\Test1.xlsx") $strFormula = ...
3
votes
0answers
28 views

Besides looking dumping $PSVersionTable and dumping the variable and env “PS-Drives”, what else can I do to compare PowerShell environments?

Besides looking dumping $PSVersionTable and dumping the variable and env "PS-Drives", what can I do to compare PowerShell environments? Here's the problem: I have very similar machines running ...
0
votes
0answers
40 views

“Please Wait” When running startup script, only on Windows 8.1

I have a startup script and I have been testing it on 3 different virtual machines. These machines are running different versions of Windows(7, 8, and 8.1). They all have the same Group Policy applied ...
0
votes
2answers
16 views

Setting to Show/Hide Hidden items on a Folder

Where is the setting to display or not display hidden items on a particular folder? For example, if the global setting is to show all hidden files, how would I change the seeing on the Desktop ...
1
vote
0answers
95 views

How can I force dnscmd.exe to provide its output in English?

How can I force dnscmd.exe to provide its output in English? I have automation that parses the output of various dnscmd commands, such as dnscmd /info > dnsInfo.txt. I'm using PowerShell to ...
1
vote
0answers
135 views

NRPE (Winrpe) Powershell Command - Unable to read output in Nagios

I'm trying to run an Powershell script from NRPE.cfg and get the output in Nagios. When i run the script on the local (Windows) server, everything is just fine. But when i put it in the NRPE.cfg en ...
3
votes
3answers
4k views

GPO: Run PowerShell logon script after explorer.exe has been loaded

I know there is the GPO setting "Computer Configuration => Admin. Templates => System => Scripts => Run logon scripts synchronously". This, however, ensures that logon scripts run before ...
0
votes
1answer
313 views

Puppet not running PowerShell script on Windows 2008 server

The Puppet agent on my Windows VMs is not executing PowerShell scripts. I have tested it with a very simple script as well. The script is stored on the C drive as test.ps1. Its contents are as ...
2
votes
1answer
3k views

PowerShell script not completing what it should do when scheduled with Windows Task Scheduler

I found a script that can delete files over X days old and changed it a bit so that I will scan different network folders to see if there are files that are older than X days. Now when I run the ...
0
votes
1answer
28 views

Windows Server 2012 - Find files related to a Role or Feature

I have a strange requirement from a client. I need to be able to enumerate the list of files/folders that have been installed by a Role or Feature in Windows Server 2012 (R2 if the release# matters). ...
1
vote
1answer
48 views

How can i create an install a domain signed certificate in IIS using PowerShell?

In my environment we host a whole lot of websites and WCF webservices in IIS (on Windows 2008 R2 and Windows 2012). We are in the process of enabling HTTPS on these sites. This goes as follows: ...
4
votes
6answers
25k views
3
votes
1answer
909 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 ...
1
vote
1answer
340 views

Run a PowerShell command as NT AUTHORITY\SYSTEM

Is there a way to run a PowerShell command as NT AUTHORITY\SYSTEM from a script? I know I can use psexec and get a PowerShell prompt running as NT AUTHORITY\SYSTEM, but I was wondering if there's a ...
1
vote
1answer
32 views

How does SCSM Relate Affected Users to Service Requests?

I'm using the built in SCSM cmdlets and the SMlets powershell module. I'm able to query Service Requests, but I can't seem to figure out how to get the Affected User of a given Service Request. I'm ...
4
votes
1answer
41 views

Win32_OperatingSystem.FreePhysicalMemory and $_.TotalVisibleMemory giving output in wrong units

I've been putting together a pretty simple script to monitor some aspects of our Terminal Server farm usage and am implementing a section where I check the memory usage on the servers at a given point ...
2
votes
2answers
92 views

Reporting SCEP update and scan

I am using Microsoft System Center Endpoint Protection on all of the workstations I manage. For all three major platforms, it is a pain to get it to report on when it was last updated and last ...
1
vote
0answers
58 views

Powershell execute Queries using SQLPLUS

I have a RHEL server with Oracle 10G installed. I need to write a powershell script to query my database and get the output. I have imported Posh-SSH module and am able to connect to my RHEL server ...
2
votes
2answers
9k views

Run Elevated Powershell prompt from command-line

Is there a way to run a Powershell Prompt with Elevated privileges from a command linein Server 2012? Problem is this is 'Minimal Server Interface' mode without full server-gui installed so I can run ...
0
votes
1answer
54 views

Powershell: invoke-expression with “find”-command

I need to call DISM.exe via its absolute path which changes dependent on system architecture. Therefore, I store the filepath of dism.exe in a variable and then proceed to execute the wntire command ...
1
vote
1answer
21 views

Large number of unmanagable groups in Exchange 2010 following migration from Exchange 2003

Recently we migrated from Exchange 2003 to 2010, and now we have many groups greyed out in the 2010 Exchange Management Console, because they are not Universal Groups. While these groups are ...
6
votes
1answer
88 views

How can I modify an existing scheduled task using Powershell?

I am working on some release automation scripts that use Powershell to update existing scheduled tasks which execute various applications. In my script, I can set the Path and Working Directory of the ...
4
votes
2answers
26k 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: ...
0
votes
1answer
90 views

Powershell | DownloadString | External website | Return

I'm a totally powershell newbie, so please be indulgent ;) I'm trying to write a script where a machine check an external website waiting for a the word: "test" to execute a download. The things goes ...
0
votes
1answer
45 views

List mapped zombie drives in powershell

I'm writing a little powershell script for some basic logs that have to be generated. Right now I'm stuck with logging mapped network drives: $colDrives = Get-WmiObject Win32_MappedLogicalDisk ...
2
votes
0answers
12 views

Deploying Server 2012 with DNS role using WDS and answer file

I want to deploy an image using WDS on Server 2012. I will be using an answer file for unattended installation with little touch as possible. My answer file works great but I can't get the auto-logon ...
1
vote
2answers
969 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
29 views

Powershell DSC uses the incorrect certificate file for encryption where node names partially match?

I think there's a bug in the way that DSC chooses the certificate file that is used for credential encryption, such as with the Service resource and a PSCredential. The DSC configuration uses the ...
3
votes
2answers
2k views

How to force powershell to refresh cached data? Get-ChildItem results for PSDrive not current

Import-Module WebAdministration $pool = "ChannelServices" $wp = Get-ChildItem "IIS:\AppPools\$pool\WorkerProcesses" Get-Process -Id $wp.processId Restart-WebAppPool $pool sleep 5 Get-ChildItem ...
0
votes
0answers
32 views

Windows PE: Powershell is not installed & error 0x80070002

Trying to run a task sequence. In the last step, I'm trying to run a powershell-script to install various IIS-features. At this step the task sequence terminates with an error (can't remember error ...
1
vote
0answers
21 views

Powershell: Pass parameter by name toa com object function

How can I pass parameters to a com-object function by name rather than by position? Specifically, I've a com-object function (Word document com-object SaveAs2) and for example I want to pass values ...
3
votes
1answer
2k 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" ...
2
votes
4answers
3k views

PowerShell script, showing commands run

I am playing around with PowerShell scripts and they're working great. However, I am wondering if there is any way to also show all the commands that were run, just as if you were manually typing ...
0
votes
0answers
16 views

Access denied while settings FSRM quotas with powershell

I'm trying to set size quotas on the users personal directories in the organization. When using the Gui (fsrm snap-ins), everything works as expected. When trying to use powershell cmdlets to ...
4
votes
2answers
5k views

Manage a Windows 2003 Active Directory Domain with PowerShell?

Can you manage a Windows 2003 functional level domain with the Active Directory PowerShell modules? The modules were introduced with Server 2008 R2, so they don't work on Server 2003, but I have read ...
2
votes
1answer
107 views

Get-ADUser -Properties MemberOf returns nothing

Something that is kind of weird that I haven't ran into before. We just did a domain migration and so now when I run a Get-ADUser {username} -Properties MemberOf against a standard user the MemberOf ...
2
votes
1answer
156 views

Powershell - Sort-Objects, list of IP Adresses

I got a /20 network and I want to know all used IP Adresses and their attributes like the MAC, the name and the description plus all free addresses between the used ones so that I got a long list ...
0
votes
1answer
1k 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 -> ...