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)

-2
votes
2answers
129 views

Powershell script to restart automatic Windows services and notify if failed

I found a Powershell script that checks all automatic services on Windows servers and if they are not started, tries to start them. Here is the link ...
-2
votes
1answer
35 views

Modify multiple accounts script

I need a script to make modifications on multiple accounts. Within the account, in general info, the display name should include “name +surname” + Custom Title. So the script should just add the ...
0
votes
0answers
27 views

IIS - Rewrite with PowerShell

I want to add a URL redirect rule to a specific Web.Config/Site. I know how I can do it with the GUI. I know how I can do it with the Web.Config. (The URL Rewrite Module is installed) But how can I ...
0
votes
1answer
47 views

Powershell archiving script

I found the below powershell script on "Hey, Scripting Guy! Blog" it is a great arching script. I modified it to meet my needs of a log file being created and sending an email. However i discovered ...
3
votes
0answers
81 views

Powershell DSC File copy - Workgroup machines

I've got a machine that I need to copy files to from a network share (on domain) for a deployment from a machine that's off domain. Currently I have the following code; Configuration deployWebsite ...
1
vote
1answer
48 views

Is there a supported Windows CIM/WMI provider for Dell PERC Generation 11 or later?

I have Dell OpenManage Server Administrator (version 7.4) for Windows installed on a 12th generation server with a PERC H710P. That machine has a root\cimv2\dell namespace which does not seem to ...
1
vote
4answers
87 views

How can I tell which of my nested AD groups a user is member of?

I have a set of nested AD groups: group subgroup1 subsubgroup1a subsubgroup2b subgroup2 subsubgroup2a userXY subsubgroup2b I'm using "group" to grant access ...
2
votes
1answer
29 views

Accessing DelegateListLink Property in Exchange Online?

I need to give a couple of users ReadPermissions to some mailboxes. And I need the read-only mailboxes to appear in the users' Outlook via auto-mapping. I know that you can achieve this via the ...
1
vote
2answers
199 views

Powershell - Find all users with password never expires

I am looking to query AD via Powershell in order to see all user accounts within my forest who have their password set to never expire. I found a few scripts online using a quick google search but ...
0
votes
1answer
19 views

Reconfiguring large Hyper-V network for speed with failover

I currently have 10 IBM x3650 M4 Servers. Each consisting of a minimum: - Dual Xeon - 192GB - 384GB - 2TB SSD RAID 10 (8 x 500GB Drives) - 4NIC All hardware is redundant, PSU, CPU, RAM etc. Each PSU ...
0
votes
1answer
43 views

Azure internal DNS search suffixes

I mainly use Azure for IaaS purposes (Linux and Windows VM's). We have a strict Front-End (FE) / Back-end (BE) segregation policy. FE and BE are in the same Virtual Network, but in different ...
1
vote
2answers
91 views

How do I exclude an imported list of directories from a Get-ChildItem list?

Our online backup software is skipping files and directories when uploading. It seems random, but I'd like to see if I can compare a list of files in the selection to the list of files in the cloud to ...
0
votes
0answers
144 views

Can't get MS Office mass delpoyment working. Update Not Running?

I am trying to mass deploy Office 2016 at work and I am testing it on one machine. I am using the following scripts and instructions. ...
1
vote
1answer
63 views

Using powershell to clean up text file

Been struggling with this and wondering if someone can help. I have a large text file that have extra data in it I want to strip out. Here is a sample of the input file: Text In Page - 1 S Dept ...
1
vote
2answers
142 views

How to get “Physical Path Credentials Logon Type” for site and application?

I have an IIS 8 website setup with an application within. Using Powershell how can I get the "Physical Path Credentials Logon Type" setting (defaults to ClearText) for both the main site and the ...
0
votes
0answers
73 views

AWS Cloudwatch custom metrics using powershell throws error

I am configuring custom cloud watch metrics for windows ec2 instance. The command which I use to invoke the script manually is C:\Cloudwatch\Memory.ps1 -aws_credential_file ...
2
votes
4answers
230 views

Email notification when automatic service is not started (Windows Server 2012 R2)

We have a few servers (Windows Server 2012 R2) in our environment that install updates automatically and restart after that. After the restart we would like to check the status of all the (Windows) ...
1
vote
1answer
26 views

rabbitmqctl set_policy drops caret (^) anchor from regex pattern

I am running this from PowerShell, so I'm not sure if this would happen in a different environment (the regex itself just includes everything except for those starting with 'amq.'). When I run the ...
-1
votes
1answer
116 views

Script/Batch If Directory is a certain age then run .exe

I currently have a batch file that looks to see if a folder exists and then if it does it runs the uninstall exe within it and then installs the program with an msi. I need to alter it or just convert ...
1
vote
1answer
112 views

Why are Active Directory password resets ignoring the Password History Count rule?

I have a situation whereby an AD domain I am working with has a sensible enough password policy in place (e.g., sufficiently high PasswordHistoryCount, MinPasswordLength settings etc.). I can change a ...
0
votes
1answer
43 views

Scheduled task PS script location best practice

Since there isn't a straightforward way to store and run scripts locally on domain members, I'm resorting to manually store them in a common location across the board and then deploying a task ...
0
votes
1answer
37 views

PowerShell - Validate Secure Credentials

Not sure why this is not working. I've seen other people do the same but I'm using secure creds and not sure if that has something to do with it. The $domain.name is coming back empty ...
0
votes
1answer
88 views

Powershell command for extracting all users from a domain

Get-ADUser -SearchBase "dc=contoso,dc=local" -filter * -properties Name, Surname, samAccountName, Enabled, PasswordNeverExpires, PasswordExpired, PasswordLastSet, MemberOf | Select Name, Surname, ...
1
vote
1answer
54 views

Why is Get-DPMDatasource not recognised in Powershell? (Using DPM Module)

I am using Import-Module DataProtectionManager To have access to DPM cmdlets in powershell. (DPM Version 2012R2) Unfortunately, Get-DPMDatasource is stating it is an unrecognised cmdlet. Without ...
1
vote
1answer
28 views

Modify “Policy” without Group Policy: Best Practice?

I have a need to address some policy settings on a number of machines that are not on a domain. Specifically, we are dealing with a technology conference lab, built with loaner machines from various ...
2
votes
1answer
191 views

Where is Get-AzureADApplication?

So I have a PowerShell script that will create a new Azure AD Application using New-AzureADApplication. And I can remove it later using Remove-AzureADApplication. But Remove-AzureADApplication ...
2
votes
3answers
120 views

Scheduled Task for Powershell Script

So I'm trying to run a powershell script on a schedule. Every morning at 6am, repeat every hour of the day. Here is the script itself: Get-Content C:\Users\administrator\Desktop\users.txt | ...
20
votes
2answers
1k views

HALP! I've inherited a permissions nightmare for redirected folders/home directories

My new employer has folder redirection setup for its hundreds of users, and the person who set it up didn't really know what he was doing. As a result, the best practices for permissions on ...
0
votes
1answer
231 views

New-AdUser : The specified account already exists

I am trying to import some AD Users using a powershell script and a file.csv but I am getting this error: New-AdUser : The specified account already exists Here is the script: Import-Module ...
4
votes
2answers
439 views

Is it possible to get a windows-version from a powershell command on Windows Server 2016 Nano?

I'm using the latest preview of Windows Server 2016 nano. Using a remote powershell session, I connect to the remote system via Enter-PSSession, and then I tried to use the most common techniques ...
3
votes
1answer
180 views

Display PowerShell in SCCM task sequence

I'm working on a SCCM OSD task sequence using a package and the 'run powershell script' option in the task sequence. I need to have the script prompt for user input. If I run the script using the F8 ...
0
votes
0answers
37 views

PowerShell module works but NOT in AWS PowerShell

I am currently trying to use the PSlogging module within AWS PowerShell for creating logs. Now the module works fine in the standard PowerShell but in AWS PowerShell I am getting errors, I even did a ...
0
votes
0answers
52 views

Compress traffic when copying a lot of files over network between two Windows server?

The tools under unix/linux, e.g., scp, rsync, etc., support compression when copying files. Does any Windows (Server) tools do the compression when copying? I will need to copy 5TB of text files ...
-1
votes
1answer
28 views

LDIF Disable script

I have a long list of users to disable every week and I am trying to figure out how can I write an LDIF script to check if users in AD are disabled and if not to disable them and move them to another ...
-1
votes
1answer
43 views

How to duplicate a directory structure of one Windows machine to another one? [closed]

And the following are the extra requirements. Duplicate all the attributes, for example, the encryption and compression, as well. Security settings (Optionally copy Sharing)
2
votes
1answer
44 views

How can I export to CSV a custom output along with Module properties? [Powershell]

Here is my code, I am pulling user names, email addresses and a random password and would like to store these nicely in a CSV. How can I export to csv a custom property like my custom generated ...
0
votes
1answer
48 views

Powershell to query computers in domain and get cert value

we're looking at getting a list of all computers in the environment and see what certificates are on the computers. We will need to know if they're sha1 or sha2 hash. I've looked online and can't ...
0
votes
0answers
32 views

PowerCLI - Network nested ESXi

Is there a way to configure the management interface of a nested ESXi Guest over PowerCLI? I'm looking to automate the configuration of a nested ESXi VM for testing customer configurations / ...
0
votes
1answer
41 views

Email address Policy is invalid

I have setup an accepted domain, everything in the background is done, I am in the process of setting up the mail policy using the following command: New-EmailAddressPolicy -Name “x.com” ...
0
votes
0answers
53 views

How to refresh agent if agent unreachable using PowerShell?, Microsoft DPM

I am currently writing an auto-healing script in Powershell to manage DPM alerts. On an AlertType = 2, AgentUnreachableAlert (Agent Unreachable), I am required to refresh the agent. I have a list of ...
2
votes
1answer
73 views

How can I correct my foreach loop in powershell for every Active Directory OU user?

Goal: Create a for or foreach loop to execute some code (in this case, just print x) for every user in an OU. Im using powershell 2.0, with ActiveDirectory module. So far: This is what I have (see ...
0
votes
2answers
162 views

Why is the Set-ClientAccessServer cmdlet throwing a DataValidationException

The command I'm trying to execute is [PS] C:\Windows\system32>Set-ClientAccessServer -Identity CCSEMAIL2010 -AutoDiscoverServiceInternalURI ...
0
votes
1answer
100 views

Retrieve “same as parent folder” A record using Get-DnsServerResourceRecord

I am trying to retrieve a single A Record from a zone. Here's the Powershell command I am using(showing only relevant columns) Get-DnsServerResourceRecord -zonename search.contoso.com -computername ...
3
votes
1answer
38 views

Microsoft DPM, What are the Type Values in the Alert Table (SQL Backend)

Currently I have a PowerShell script which hooks into the SQL Backend of DPM and queries the list of unresolved alerts. In the table tbl_AHP_Alerts There is a field called Type. This Type Field ...
0
votes
2answers
49 views

in WSUS is there a way to set the DOWNLOAD AUTOMATICALLY at night but APPROVED MANUALLY in the morning what update to use/deploy to the clients?

right now when i approved updates in the morning the WSUS eats up the bandwidth of the internet which is affecting our business operations. is there a way to set the DOWNLOAD AUTOMATICALLY at night ...
7
votes
2answers
426 views

Need to change system locale on Windows 2012 R2 from en-US to en-GB

When I start an Aws Ec2 Windows 2012 R2 instance it always comes with a default en-US locale. However I need to change two of the existing instances to be en-GB as if they were installed like that in ...
4
votes
1answer
254 views

Change AD users attributes via Power Shell script

In the domain I'm working we created an attribute "regulationMatrix" . When I try a powershell command like get-aduser USER -properties * that specific attribute shows up only if it has a value set ...
0
votes
0answers
142 views

ExportedCommand empty custom module PowerShell

I have a custom module in Powershell. It consists of two files the Copy-Move.psm1 and the Copy-Move.psd1. In the Copy-Move.psm1 I have several functions from which I only export the function ...
0
votes
1answer
23 views

Get-Process doesn't work with one user but works fine with another user

get-process -ComputerName Win2012r2 get-process : Couldn't connect to remote machine. At line:1 char:1 + get-process -ComputerName 10.10.1.54 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo ...
2
votes
2answers
149 views

Powershell script to Inventory File Types

I have been writing a script to inventory drives by specific file types. (AVI, MPG, MP3, etc....) I can get the base script to work using only a set drive and extension, but I would really like to ...