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
1answer
10 views

Printer Audit 64bit

I'm running the following script to get a report on installed printers : https://community.spiceworks.com/scripts/show/2186-export-printer-information-to-spreadsheet?page=1 However when the script ...
1
vote
0answers
39 views

Script for user movement based on OU

Any script which will read the department attribute of users (under an OU and sub OU's) and move them to different OU named as department ( already created OU structure name same as their department ...
-2
votes
0answers
26 views

Delete specific files older than XX days in a directory and its subdirectories per Powershell

I have a quite specific task. I have a share \share, which has a lot of subfolders. My task is to delete all files within that share (including all subfolders) which have *.xyz extension and are ...
0
votes
0answers
37 views

Hardware Inventory Powershell

This may be the best hardware inventory script I use it from here Link The only thing I would like to add is The total size of hardrive instead of drive letters cos virtual drives may not have been ...
0
votes
2answers
89 views

How to calculator IP range and subnets? [on hold]

I am trying to find exact formula for finding the IP ranges for the below sample input 10.144.26.192/28 I am getting different IP count in different portals. I used the below online IP range ...
2
votes
0answers
32 views

Changing Windows Server 2012R2 maintenance time with PS

I'm struggling with this for the past few weeks and I hope someone has THE answer that works. At my work we use VMWare and I've build a automated deployment of Windows server 2012R2 with Powershell, ...
1
vote
1answer
37 views

How can I use PowerShell to enable NTFS compression, in place, on log files older than x days?

I have an application server, running Windows 2012 R2, which generates a high volume of log files, to the point that it runs the application volume out of free space on a semi-regular basis. Due to ...
1
vote
0answers
23 views

How to disable “do not allow drive redirection” local policy not using GUI?

I need to do it preferably using powershell/batch but after searching there is only some instructions for creatig adm/admx files. Is there an easier way to do this? I've also found a registry key ...
1
vote
2answers
19 views

Exchange 2010 | Get-MailboxStatistics where clause

I have exchange server hosting emails for multiple domains. How can I make the Get-MailboxStatistics cmdlet to display mailboxes and sizes only on mailboxes that end with a certain domain? Something ...
-2
votes
1answer
41 views

How can I add firewall rules remotely without GPO?

I know the best way to do this is through group policy, however that's not an option right now due to our really old server running Win Server SB 2003 (we're planning on decommissioning it asap, but ...
1
vote
1answer
40 views

Assistance with Powershell Do While loop

I am writing a powershell script to create a new user in AD and then add a mailbox to them. The issue I am experiencing is that the script runs too fast and tries to jump to the next step (enabling ...
0
votes
2answers
36 views

how to release shared files' locks from other systems before server downtime - with Powershell?

Is there a way to use Powershell to clean up/release file locks on a server when it's time to upgrade? we have other systems connecting to the server's shared resources over the network and some files ...
2
votes
2answers
39 views

script to temporarily block remote users from logging into a windows server during downtime

I'm looking for a solution to the following issue: we have a windows server with a bunch of people logging in remotely to work on stuff; when we need to upgrade the server, we issue warnings via ...
-1
votes
0answers
32 views

Powershell to find conflict objects in Active Directory

We are doing AD remediation in our enviornment with ADRAP tool and received lot of errors. One of the error where I stuck is Conflict Objects. Below is the description. When two or more objects with ...
0
votes
1answer
25 views

WinRM cannot connect

I am trying to get two workgroup machines (both are Windows 2012 R2) to talk to each other using PowerShell via WinRM. Let's call them ServerA and ServerB. On both machines I ran the following ...
0
votes
1answer
21 views

Getting List of Members for DL's from .csv/.txt

I've been tasked with getting a list of all members for a list of 500+ distribution lists (DLs). I currently have the list (of DLs) in an excel/csv that basically lists the names and primary smtp ...
4
votes
1answer
106 views

Get-ADGroupMember $Group fails when $Group contains principals from other domains

I've noticed that when I use Powershell to get the group membership of an Active Directory domain security group, the Powershell cmdlet Get-ADGroupMember $Group fails with the error message: PS ...
0
votes
1answer
10 views

List a server's available WMI Performance data classes

How can I get a list of all WMI performance counters classes on a given server, to use in scripts for monitoring purposes. I know one can use the performance monitor, but the classes displayed don't ...
1
vote
1answer
51 views

Check If A Service Account Has Logon Interactive Privileges

I want to loop over all my domain service accounts and make sure that people can't log on the server using that account. How can I check if a service account has interactive logon privileges and/or ...
1
vote
1answer
34 views

Powershell and par2 command line

I have a working script which 7zips sql bak files to a network location (helped by the good people here:)). since 7zip doesn't have recovery records i would like to use par2. now, i have put together ...
0
votes
0answers
17 views

NPS RADIUS 802.1x and configuring for large number of VLAN-s

Problem I've got a network with large number of VLAN-s (200+), and ActiveDirectory with 2012R2 servers, with all users and computers. I've also got NPS RADIUS server setup, properly working with ...
1
vote
0answers
31 views

Why does Get-Winevent in parallel workflow wants to use PSRemoting?

I'm building a wrapper script for Get-Winevent to search multiple computers' event logs in parallel, using multiple search criteria. I'm contructing a XML filter for Get-Winevent, then call this ...
1
vote
2answers
80 views

Getting NIC speed from Powershell on Win2008 R2 Server

I am trying to get the NIC speed via Powershell on some of my servers. For my lab server I know there is a 1GB NIC in there. However, when I do this via Powershell I get the below weird number: ...
0
votes
0answers
22 views

Get-WmiCounter Win32_PerfFormattedData_NETFramework_NETCLRMemory Incomplete in non admin context

So I have created a script to gather counters using Get-CimInstance (which supercedes Get-WMIObject) and run it as a services via srvany.exe. I get an issue where for the .Net CLR classes, some ...
2
votes
1answer
50 views

Server 2012 R2 - Features on Demand - role not actually being removed

This is for learning purposes: I'm running a Server r2 machine and I'm trying to remove feature WINS. I run uninstall-windowsfeature WINS -restart -remove, I then restart, and then run ...
0
votes
1answer
33 views

JSON Parse Error in Windows Sensu Client Powershell Setup Script - unexpected character at line 1, column 1

I am creating a install script for Sensu on Windows and am getting this error upon starting the service: { "timestamp": "2016-04-14T23:05:45.043371+0100", "level": "warn", "message": "config ...
1
vote
1answer
126 views

How to get ADDSDeployment module on Windows Server 2008 R2 SP1

I wonder to use AD DS Demployment CMDLets (Install-ADDSDomain, etc.) on Windows Server 2008 R2 SP1. I have installed AD-Domain-Services feature and in the list of available modules (Get-Module ...
0
votes
1answer
18 views

Testing if PowerShell script is being ran via Enter-PSSession?

I've got a PowerShell 2.0 script which performs some tasks involving non-MS apps which it launches. This works great if running via RDP or local console, but ends up deleting files when not intended ...
0
votes
1answer
58 views

Server 2012 R2 - Features on Demand issue with powershell - Pulling roles/features from remote share

This is for learning/lab purposes. -Two 2012 R2 servers. Server 1 is Standard GUI and server 2 is Server core. -Server 1 is updated, Server 2 is not updated at all with any windows updates -Workgroup ...
2
votes
2answers
44 views

Extracting GPO through Commandline/Powershell

Im writing a script through powershell and i would like to extract the whole local policies. I understand that secedit will exttract the Account policies only, and the only way to do this is via going ...
0
votes
0answers
15 views

RSH from Linux to WIN7 and access COM port

I have a script(run on a Linux machine) , and does the following rsh to a Windoes machine (rsh XX.XX.XX.XX CMD) cd to a directory (cd YY) run a script (say ZZ.pl --someargument) it runs fine when ...
0
votes
1answer
82 views

Creating active directory users with powershell - the mapped home folder is not mapping until edited

I'm creating active directory users in bulk from a .csv using powershell. Each user has their profile home folder path mapped to a drive letter. The script runs through fine, users are created and ...
0
votes
2answers
27 views

Unable to remove publicfolder replicas on exchange 2007

I try to decommissioning my Exchange 2007 server after migration to Exchange 2013, to migrate to 2016 in the future. I removed all mailbox databases, but not the publicfolder database, i got an error ...
0
votes
1answer
28 views

Importing Bulk Users from .csv file leads to user logon name and domain being blank

I have the following issue when adding bulk users through a .csv file: the user logon name and the domain are blank, however the user logon name (Pre windows 2003) is showing ok. Because of this, I am ...
0
votes
0answers
7 views

IIS - overrideModeDefault enforced in PowerShell, not IIS UI

I am trying to modify an IIS Web Application that is installed, and change the Authentication Methods. The Default Web Site is set to alloy Anonymous, and disable everything else. When I use the ...
0
votes
1answer
23 views

Azure Resource Manager Virtual Machines LUN limit of 4?

Add-AzureVMDataDisk (for classic VMs) allowed me to specify a LUN from 0-15. Now Add-AzureRmVMDataDisk (for ARM VMs) has a limit of 0-3. Why the change? How can I add more that 4 disks to my ARM VM? ...
1
vote
0answers
26 views

powershell hash building from an array [migrated]

title: powershell forloop with array and hash? I know how to do this in perl and unixshell. I don't see it in powershell. So I will ask. I will keep my question simple. if I have a list, I would ...
0
votes
1answer
26 views

Azure Resource Manager and Powershell DSC - changes not being applied

I have an ARM template with a Powershell DSC extension section running the following DSC: Configuration Name { Node MachineName { #IIS Role WindowsFeature IIS { ...
3
votes
0answers
64 views

Compressing folders with long paths

I am now the proud owner of my company's off-boarding script (Yay!). I have been going through the code and testing, and I noticed that on some users' homefolders I am hitting PowerShell's 260 ...
1
vote
2answers
150 views

Why is my logon script not mapping any drives?

I've written a logon script in PowerShell. The Script is embedded in GPO and runs when a user is logging into the domain. My Problem is, that the drives I deploy in the Script don't get deployed. I'm ...
0
votes
1answer
25 views

Get-AzureStorageAccount is not returning premium accounts (only standard accounts)

Does anyone know why the Azure PowerShell cmdlet Get-AzureStorageAccount only returns standard storage accounts? I have two standard and two premium storage accounts in my one Azure subscription, and ...
1
vote
1answer
31 views

How to find out IE's Proxy settings for all users on a server (i.e. Windows 2008R2)?

I am trying to pull this information with the following below powershell script but it is only fetching the information for my profile and not all the users that have logged in to the server. Am I ...
3
votes
1answer
56 views

How can I force a client to update its IP address in SCCM?

I am testing some networking issues with a machine that i need to move through the organization, this make the machine to change its ip. SCCM need to update this ip (highlighted in the picture) in ...
1
vote
1answer
51 views

How to hide command window at while running powershell script through the task scheduler?

I have powershell script with GUI form which show message by condition. This script is runnig through the task scheduler every 15 minutes. Every running shows me concole window, then GUI form with ...
4
votes
0answers
57 views

Using defaultAuthenticationType with PowerShell Web Access

PowerShell web access lets you choose the authentication type. By default, it uses a value of Default, which ends up being Negotiate. I have set up CredSSP to allow logging into the PSWA server itself ...
1
vote
0answers
29 views

Full control over powershell colors

I wanted to customize my shell by enumerating all the possible options and giving them alternate values. I have searched high and low, but there is practically no good guide on doing it, the closest ...
2
votes
0answers
34 views

Problems with a script uninstall (SCCM 2012) and its causing the detection method to fail

We use the Powershell Application Deployment Toolkit for deploying applications in SCCM. I'm currently working on uninstalling Sophos VPN from machines in a certain collection in our environment. ...
1
vote
1answer
30 views

PSEXEC - The system cannot find the path specified

I am trying to initiate a Endpoint protection scan on a network share. I found that I need to utilize PSEXEC to complete this but it is having problems connecting to the share. I mapped the drive ...
0
votes
3answers
34 views

Azure Powershell - Staying Logged in

I need to be able to store many azure subscriptions and load them when needed. I have saved the profile with... Save-AzureRmProfile -Path 'C:\Temp\profile.json' Then i can load it with ...
0
votes
1answer
62 views

AD automation setting home drive and logon script

I was able to set home drive and and logon script for each user but the problem is it doesn't creates home folder something looks wrong with get-aduser -filter * foreach {New-Item -ItemType Directory ...