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
votes
0answers
9 views

How do I find what version of WSUS I have installed on Windows Server 2012?

I'm trying to automate WSUS with powershell, however to do this I need to know what version is installed. How do I find this information? The server is using Windows Server 2012 R2 Standard. Thanks.
6
votes
2answers
1k views

How to get robocopy summary information involved in powershell?

I have a quick script written to compare file differences across servers, and then give a prompt for whether to mirror the changes. I'd like it to intelligently NOT prompt for copying if there aren't ...
1
vote
1answer
30 views

How to receive email notification of non-AD joined DHCP leases?

This answer to theCleaner's question helped me some Windows DHCP Server - get notification when a non-AD joined device gets an IP address but the answer to his question involved Quest Poweshell ...
5
votes
2answers
186 views

Automating WSUS via PowerShell

I have written a script with the intention of quickly managing the WSUS process, and I have a few things I hard coded in, but would rather get with PowerShell. In particular, the 'Target' groups for ...
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 | ...
1
vote
3answers
31 views

Windows Server 2008 send an alert using Powershell

I want to send an alert with Powershell. But I want to know if there is another way to send an alert, other than email. Thanks. P.S. I can't send emails because I don't have an smtp server, and due ...
2
votes
3answers
1k 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
votes
0answers
14 views

Output the filtered objects of Where-Objects to send in Send-MailMessage cmdlet

I am looking to script and email the output of the following: Where-Object { $_.LastWriteTime -lt $deadline } In which $deadline is $date.addDays(-30). How can I output the filtered objects?
17
votes
4answers
69k views

How to create Active Directory user account with powershell

I am constantly setting up research and development environments that require active directory accounts. Since we place these environments in isloated networks each environment needs its own active ...
0
votes
2answers
38 views

Run Command directly from Powershell file

I am get above error, when i am trying to run command from .ps1 file. Please let me know, how to run command directly from powershell prompt,Without double clicking on this file. Sorry for asking ...
1
vote
1answer
40 views

Run Command from Powershell file

I am getting below Error. while running command by copying from Powershell file, this file i have opened in notepad, than I am running this command by copying and than pasting in Powershell prompt. ...
0
votes
1answer
31 views

Reset AD expired password with user credentials using a PowerShell script

there! I am new to Powershell and I need some help with this script. I have just began to work helping our sysadmin with some tasks inside a Windows Server 2008 R2 AD Domain environment. I am trying ...
0
votes
2answers
36 views

Evaluating nested groups in Powershell expression

I have a management scope and management role assignment set up which allow a service account to impersonate Exchange mailboxes belonging to users in a specified distribution list. I set up the ...
2
votes
0answers
24 views

Powershell Download via HTTP using Proxy and Checking Remote File Size Fails on Second File

I have a powershell script I'm developing, which will download files from a HTTP server going through a proxy and including a UN/PW on the server. I have files downloading fine, but some files are ...
2
votes
1answer
23 views

What it means when PM(K) of ps gets negative values?

I got the following negative PM (The amount of pageable memory that the process is using, in kilobytes) values when execute the ps command. What it means when the values are negative? PS H:\> ps ...
0
votes
0answers
16 views

novell ndir alternative for x64bit windows 7 [on hold]

I am trying to get the owner of a file in a novell file share, however when i try to run ndir it gives an error because ndir is x16 exe and i am using a x64 windows 7 machine. Is there an alternative ...
3
votes
2answers
8k 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 ...
3
votes
4answers
3k views

Powershell Get-Process : Couldn't connect to remote machine

Been struggling with this for a couple days now. I'm getting the following error: PS C:\> get-process -ComputerName Win2012r2 get-process : Couldn't connect to remote machine. At line:1 char:1 ...
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 ...
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 ...
1
vote
2answers
3k views

With Powershell, how can I get the id of a process owned by a specific user?

Using Powershell, I want to do the equivalent of Unix ps -auxc | grep Emacs kill -9 364 (Assuming 365 was the pid the first command told me.) How do I do that? I find it incredibly hard to get ...
23
votes
2answers
2k views

Is there a way to loop through Windows 8 Apps and remove them all?

Windows apps are annoying and I would like to remove them. Been playing around with Powershell and scripting and I wanted to know if there was a way I could make Powershell to loop through all the ...
1
vote
3answers
2k views

SNMP custom commands on Windows

For a while I've monitored UNIX/Linux servers using SNMP. Modifying the snmpd.conf file and adding something like view systemview included .1.2.3.4.5.6.789 pass .1.2.3.4.5.6.789 /bin/bash ...
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:\> ...
7
votes
2answers
2k views

powershell: How to check if S.M.A.R.T is enabled on remote machines

I was attempting to get disk info of remote machines, including whether or not SMART is enabled on the drive by using the win32_diskdrive class. This is trickier than I thought. While it's easy ...
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 ...
5
votes
1answer
47 views

How to get SCCM to recognize return codes from Powershell script completion?

I'm using an SCCM 2012 application deployment to install software. The specific install type is scripted installer as SCCM kept failing for exe validation errors. The script is powershell and ...
0
votes
1answer
55 views

Windows Server 2008 Send an email on reboot

I want to send an email when a Windows Server reboots or shutdown unexpectedly. I was reading that one way to achieve that is look for event id 6008 on System's log, and then send the alert. What ...
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 ...
0
votes
2answers
948 views

Invoke command with IP address as Target server does not works at all

Please see the following command and with Trusted Hosts enabled, this does not work: Invoke-Command -ComputerName <IP address> -port 5985 -Credential (New-Object ...
2
votes
2answers
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 ...
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 -> ...
1
vote
3answers
3k views

When using GetHostAddresses how do I get the value of a ScriptProperty?

I'm using the following to get the IP address of a web service: $o = [System.Net.Dns]::GetHostAddresses("myservice.domain.com") $o correctly returns the object properties. Address : ...
0
votes
1answer
34 views

How to show powershell input as part of output

I'm trying to get the OS version of a selection of the computers on my domain. I created a powershell command that does this but it is missing the computer name on the output. This is the command ...
5
votes
1answer
4k 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 ...
17
votes
6answers
13k views

Retrieve current domain user's full name

Using PowerShell, how can I get the currently logged on domain user's full name (not only its username) without the need of the ActiveDirectory module?
2
votes
1answer
21 views

Configuring DHCP server (Win 2012)

I am trying to do some basic testing of a DHCP server (Windows Server 2012). I'm trying to do all this testing from a laptop. The VM's are set Host-Only (or 'Private to my Mac' setting) To get ...
0
votes
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
948 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 ...
10
votes
2answers
11k 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 ...
0
votes
1answer
32 views

Connecting to Azure with PowerShell

How do you connect to Azure with Powershell? I'm specifically referring to the Service Manager system, not with Resource Manager. Also, does it make more sense to use certificates or connect with a ...
0
votes
1answer
39 views

GidNumber Powershell?

I see someone posted this small script for assigning Gid's but unfortunately im getting an error. I modified it a bit to better fit my needs but was wonder what the $groups variable meant in it? ...
4
votes
1answer
30 views

How to suppress error text with Get-DhcpServerv4Lease

I have a simple script to look through an IP range in DHCP and report all the addresses that don't have leases. There's a function that supposedly does this already, but it doesn't seem to work for ...
1
vote
3answers
2k views

How can I add mulitple user or values to an Array

I wanna create a powershell script in which I want to add multiple values to an Array (Add into Array). eg: I have 10 users in my company and want to create their AD account (without using csv ...
2
votes
2answers
37 views

Powershell to add printers based on AD Site

I am trying to map a default printer based on the location found in AD Sites and Services. I can grab the location of the computer using ...
0
votes
3answers
3k views

Get-ADGroupMember returns nothing while being completed successfully

I've tried to list all of the members of one of the groups in AD, but nothing is returned, although the command is completed successfully. It neither works with group DN specified, instead of ...
2
votes
2answers
2k views

PowerShell Script to Get a Directory Total Size

I need to get the size of a directory, recursively. I have to do this every month or so. I want to make a powershell script to do it.
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
2answers
4k views

Powershell Get-Process cannot connect to remote computer

I've been struggling with this for a few hours and can't figure this out. I have two Windows 7 computers. One is my workstation that is using Powershell to do administrative maintenance. The other is ...
8
votes
2answers
6k views

Remotely renaming a domained Win 7 computer

I'm having a hard time figuring out how to rename a Windows 7 computer remotely. This is for automating Win 7 builds in a vSphere 5 environment, and I'm trying to get it as hands-off as I can. So far ...