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
0answers
8 views

powershell recurse delete files in subfolders

I am trying to write a script to search for duplicate base file names with different extensions in subfolders under a path. For example a folder may contain file1.zip and file1.pdf and I want to ...
3
votes
0answers
15 views

Variable Network Device Alias and PowerShell DSC

I have a set of Azure Resource Manager and DSC scripts that I use to deploy a new VM to Azure and then make it a domain controller for a new domain, these have worked fine for some time, but it's now ...
6
votes
3answers
208 views

Is it possible to create a generalized configuration file for installing Windows features using PowerShell?

I'm currently trying to automate the build of a VM running Windows Server 2012 R2. At the moment the challenge is automating the addition of roles and features. Within the roles and features wizard ...
3
votes
5answers
121 views

PowerShell prompt to continue execution of code

I have a script I am using to automate WSUS processes, and the last stage of it goes on to remove all old/unnecessary files/objects. I would like to prompt 'Press 'Enter' to continue with removal or ...
1
vote
0answers
25 views

Close locked file in Windows Share using Powershell and Openfiles

I work with a lot of folder shares, but there are a bunch of locked files which have been opened by some other process. I need to close those files. So far I've been using MMC - System Tools - Shared ...
-1
votes
1answer
29 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.
1
vote
1answer
43 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 ...
6
votes
2answers
207 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 ...
-1
votes
0answers
15 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?
1
vote
1answer
42 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
2answers
39 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 ...
0
votes
2answers
44 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
26 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
17 views

novell ndir alternative for x64bit windows 7 [closed]

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 ...
5
votes
1answer
52 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
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 ...
1
vote
3answers
34 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
1answer
22 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 ...
4
votes
1answer
31 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 ...
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? ...
0
votes
0answers
21 views

Building bootable iso using mksisofs

I'm trying to build bootable linux ISO under windows using mkisofs this is the command I'm executing: mkisofs -r -V “Modified Iso” -o D:\MOR.iso -cache-inodes -J -l -b isolinux\isolinux.bin -c ...
0
votes
1answer
38 views

How can I get VMHost's operating system and serivce pack info using Get-VMHost

I am trying to get the VMHost operating system info , but I can not find the required scripts. I tired this :- Get-VMHost which return a lot of info about the VMHost,, but the operating system ...
0
votes
0answers
15 views

Unable to get the DHCP server + NIC using “Get-VMHost <hostname> | Get-VMHostNetworkAdapter -VMKernel”

I run the following command inside my powercli 5.5 release1:- Get-VMHost <hostname> | Get-VMHostNetworkAdapter -VMKernel where I got these info :- VMotionEnabled ...
2
votes
2answers
43 views

Want to Export-CSV variable with properties

I want to build a "~table" that holds information about various computer (e.g. Name, IP Address and MAC Address though more information could be added later). Here is what I have so far: $Computers = ...
0
votes
1answer
41 views

Compare three directories with powershell [closed]

Wanting to compare 3 DFS directories. helios456 wrote a nice script for two directories, I have tried modifying to fit my needs but have hit a brick wall. Winmerge, Beyond Compare and diffmerge only ...
0
votes
1answer
58 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 ...
1
vote
1answer
15 views

unable to get the IP,Mac, and other network info using (Get-VMHost).NetworkInfo

I am using powerCLI verion 5.5, and I wrote the following script:- Get-VMHost |Export-Csv -Path c:\test.csv -NoTypeInformation –UseCulture I got info for the vmhost such as used memory, build, ...
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 ...
1
vote
1answer
26 views

user authentication with powershell

I have the following simple script which I'm using to push some files to a number of Win7 and Server2008 machines. In most cases the local user has no password. However the scripts fails because I'm ...
1
vote
2answers
26 views

How to ONLY get property value

I want to retrieve IP Addresses from computer names but I ONLY want the IP nothing more. $computer = 'Server1' $computer = [System.Net.Dns]::GetHostAddresses($computer) | select IPAddressToString ...
0
votes
1answer
26 views

Can't see my Azure VMs listed in PowerShell

Whenever I try to get a list of VMs I have running in Azure, they aren't showing up when I use PowerShell to list them. I know they are they exist because I see them in the portal but when I connect ...
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 ...
1
vote
1answer
24 views

Combine/consolidate entries in array [closed]

I have a script that takes a snapshot of AD groups and check against current AD state for membership changes. It adds psobject to an array and outputs a table to a html file. the problem is i want to ...
0
votes
1answer
34 views

Accessing Reverse Lookup Zone PTR records

I want to know the right command to get and delete PTR records inside the ReverseLookupZone using PowerShell. I couldn't find the right command to access the Reverse Lookup Zone. Can you guide me, ...
0
votes
1answer
33 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 ...
2
votes
3answers
103 views

Run shell command on Azure Linux VM from PowerShell

I have a Linux server on Microsoft Azure. It's an Ubuntu 14 Server. Apparently, I've done something wrong with the UFW (firewall) configuration and now I can't ssh into machine at all. I need to ...
5
votes
1answer
168 views

Possible to use Powershell to detect if an HP server has a bad drive?

I'm trying to use Powershell to detect certain hardware failures. Can Powershell hook into normal HP events/logs/alerts to detect if a drive failed?
1
vote
1answer
31 views

New-ADGroup with Multiple -OtherAttributes?

Keep getting "The Paramater is Incorrect" I think im following microsofts method correctly but its not working, any help is greatly appriciated. New-ADGroup -DisplayName $name ...
0
votes
1answer
39 views

Create Outlook rule via PowerShell

I'm looking to create a PowerShell script that creates an Outlook rule which delays any email sent out by one minute. I have very limited PowerShell knowledge and cannot find much information on ...
1
vote
1answer
26 views

Trigger an update with Azure PowerShell DSC Extension

I'm using the DSC Extension in Azure to configure the VM's and on first deployment that works fine. However, if I've made an error in the DSC script or need to amend it I am having trouble ...
0
votes
1answer
33 views

How do I filter Exchange 2013 new-moverequest by “StatusDetail”

I am trying to make a report of "interesting" moves, errored, lagged, or slow. I'm starting with this Get-MoveRequest -ResultSize unlimited | where {$_.status -ne "Completed" -and ( ( ...
1
vote
1answer
19 views

Powershell: PSScheduledJob for non-admin

Is there a way for non-admins to use the PSScheduledJob module? For example, I tried Register-ScheduledJob without admin privilege, but it returns "Access is Denied" error. We know that we can allow ...
2
votes
2answers
52 views

PowerShell to remotely invoke Exchange with other credentials

I've been tasked with creating a script that is going to be run on multiple user machines throughout the network. The commands that we're ultimately going to have run will change the user's email ...
3
votes
2answers
82 views

Can't Get PSExec to work with Powershell

Last week I developed a script that would check if psremoting was enabled on specified machines. This week I began working on a script that would enable psremoting on specified machines but I can't ...
1
vote
0answers
24 views

Running apps on remote machine using current user credentials

I'm using enter-pssession to connect to a remote machine via Powershell. I then try to run an application via this connection on the remote machine. However, when I do this, it believes the user is ...
0
votes
0answers
19 views

Hostednetwork rejecting connections after a while

I am trying to use netsh hostednetwork to host a wireless network. The problem is that after a while (1 hour - 14 hours) noone is able to connect and already connected people get disconnected after a ...
7
votes
3answers
239 views

PowerShell - Install-WindowsFeature (and family) missing on Windows 10?

We have some Powershell scripts used to set up various dev/test/prod environments and one of them installs and configures IIS. Unfortunately these scripts don't appear to be working under Windows 10 ...
1
vote
2answers
51 views

How to extract specific emails from Exchange Online using PowerShell and move or sort them?

In Exchange Online (Office 365), I need to extract emails, from particular sending addresses, from a handful of user mailboxes, to another user mailbox folder. I've been reading about the ...
0
votes
2answers
54 views

Accept Value From Pipeline Powershell Function

I would like to create a script that tell the user whether or not PSRemoting is enabled on multiple remote machines. Here is what I have so far: function Test-PSRemoting { Param( ...