Tagged Questions

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
3answers
33 views

Replacing a string in an XML with Powershell causes MALFORMED XML

I have a rather large XML file that I need to replace some connection strings within. I use the following code to replace the strings: $temp = Get-Content .\bigxmlfile.xml ...
1
vote
1answer
35 views

Powershell sort-object, csv

I got two *.csv files. The first contains this IP, MAC, Name, Comment 10.10.122.1, 66-55-44-33-22-11, testuser1, this is testuser 1 10.10.122.100, 66-55-44-33-22-12, testuser2, this is testuser 2 ...
3
votes
1answer
24 views

New-ADUser ADException NotSpecified

I am receiving an error when I run this powershell command to add a new user: PS > New-ADUser -Name "user1" -GivenName "test" -Surname "User" -Path "ou=Users" The error returned when run is: ...
1
vote
1answer
43 views

How can I retrieve the device information?

From Windows Server 2012 R2, how can I retrieve a device's vendor name and model number without physically opening the machine? For instance, PCI cards. Get-WmiObject Win32_PNPEntity returns a bunch ...
0
votes
0answers
55 views

Can't install software with PowerShell 5.0 OneGet under Windows 10 Technical Preview [closed]

I run Windows 10 Tech Preview build 9680 in a VM. PowerShell 5.0 and the OneGet module is already included. First of all I added Chocolatey as package source: Register-PackageSource -Name chocolatey ...
2
votes
1answer
49 views
+100

How do I invoke scanstate from the USMT for a large number of PCs?

I've already customized all of my XML files, but I'm having trouble figuring out the logistics of how to script scanstate to run on a large (~50) number of PCs remotely. I have a list of PCs and the ...
3
votes
4answers
179 views

Powershell arrays and comparissons

Im a Linux Sys Admin by profession, but am having to do some powershelling. My problem is this: Im getting a list of active users from the AD with this command: $allusers= get-aduser -Filter ...
5
votes
1answer
26 views

What is the difference between Approve or Approve for Optional Install In WSUS

I have been diving into Powershell for methods to deal with my WSUS better. I have noticed that an update gives the option of Approve or ApproveForOptionalInstall. Whilte I can find many articles ...
5
votes
2answers
73 views

SSL Certificate management with Powershell DSC

I have a third-party issued certificate that I need to ensure is running on all targets in a given domain. Is there a way to ensure this certificate is installed by way of DSC?
2
votes
0answers
33 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 ...
6
votes
2answers
155 views

Managing Windows Powershell from Linux terminal

I manage some Windows Server 2012. I'm learning PowerShell to manage this servers through command line. My workstation runs Ubuntu and I connect via ssh to manage Linux servers. There is a way that I ...
0
votes
1answer
23 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). ...
2
votes
1answer
29 views

Missing DomainControllers in Active Directory Object

We are setting up a new network environment that will have two domain controllers and ran into an issue with Windows not recognizing the existing domain controllers (DC-01 and DC-02) as Domain ...
1
vote
1answer
36 views

Adding a new Exchange 2013 mailbox from Powershell error

I am trying to add a new mailbox via the Powershell and I get the following error: #New-ADUser -Name AreallyTest -SamAccountName AreallyTest -AccountPassword (ConvertTo-SecureString Password1234 ...
1
vote
2answers
60 views

relationship between user and computer

I have been using Get-ADUser and Get-ADComputer a few times to help troubleshoot problems in the system. I have seen a few ways of identifying which user is logged on a specific machine through ...
2
votes
0answers
34 views

Get-Cluster cmdlet fails when using -Name param

Summary When I call Get-Cluster powershell returns the name of my cluster. For simplicity sake, lets call it Cluster1. If I call Get-Cluster -Name Cluster1 it fails with an error. Error: ...
0
votes
2answers
45 views

Powershell script that executes another powershell remotely

It's a long story, but I need to create a SQL trigger that executes a script remotely which executes another script remotely (yeah, I know). I'm using PowerShell. I have started at the end: ...
0
votes
1answer
16 views

Which mailbox information will get-mailbox return after I move a mailbox?

Assume, I move a mailbox from one database to another. Within the retention period, get-mailboxstatistics will return mailbox information for both databases ie. there will be two entries for the same ...
0
votes
1answer
68 views

Powershell script for specifically OU

Need help with hte following, a script that can export all members of a specifically OU with in that multiple security groups. Location of the OU is; OU=Security Groups,OU=Public ...
0
votes
1answer
71 views

Powershell use Get-WinEvent with hashtable to query very specific time range

I'm trying to make a powershell script that essentially automates the account lockout tools. ideally I'll be able to get a fairly efficient query that can identify recently locked out accounts then ...
0
votes
0answers
24 views

What are the cases when get-mailboxstatistics cmdlet returns duplicate mailbox information?

I'm using Exchange 2010 and sometimes I've noticed that the cmdlet get-mailboxstatistics returns duplicate mailbox information. For example, if I move a mailbox from one database to other, the cmdlet ...
2
votes
1answer
56 views

Running Get-MessageTrackingLog as a job in Powershell

I'm trying to create an Exchange 2010 script that will search each transport server as a job. I try the following: $transportserver = get-transportserver foreach ($ts in $transportserver) { ...
3
votes
0answers
80 views

Import Powershell AD Module during MDT Task Sequence

I have written this short powershell script to rename a computer as part of an MDT task sequence: Import-Module ActiveDirectory $AdminUsername = 'domain.com\administrator' $AdminPassword = ...
1
vote
0answers
35 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 ...
0
votes
1answer
58 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 ...
1
vote
1answer
33 views

looping Get-ReceiveConnector to grab multiple receive connectors

This is on a Windows 2008R2 server running Exchange2010. I would like to use powershell and "Get-ReceiveConnector" to grab information from about 20 configured receive connectors. Ultimately we are ...
0
votes
1answer
28 views

Microsoft Exchange 2010: How can I get a count of e-mails received for a particular mailbox for a particular date?

I am using Microsoft Exchange 2010. How can I get a count of e-mails received for a particular mailbox for a particular date? For example I want to see how many e-mails ...
1
vote
2answers
41 views

Duplicate current powershell session in a new window

Is it possible to duplicate a powershell session in a new window? I often find that I've created environment variables, activated a specific python virtualenvironment, defined one-off functions, ...
0
votes
2answers
39 views

How to plan a script to be executed at session end inside a powershell script?

I am writing a login script in Powershell which install a amount of printers, depending on the user currently loggin into Windows 7. I would like this user to remove the printers it have installed as ...
-1
votes
0answers
33 views

Powershell iterate over IP Range [migrated]

I would like to iterate over my IPv4 range with Powershell. For example my IP is 192.168.0.0 and my mask is /20. Therefore my usable range goes from 192.168.0.1 - 192.168.15.254. Net-ID is ...
0
votes
1answer
47 views

Page files size from CSV

I've got the following script, that checks the page file size on a remote server, is it possible to run this against a CSV file of hostnames? clear $strComputer="computername" ...
0
votes
0answers
27 views

Unselectable (?) Property in IIS Powershell Module

dir iis:\apppools Gives 3 properties: Name, State and Applications. I'd like to isolate "Applications" but for some reason it's nowhere to be found on the Get-Member list. TypeName: ...
2
votes
1answer
458 views

How do you manually set Powershell's OneGet repository source to Chocolatey?

The OneGet Powershell module should ship with the default repository being Chocolatey. This is shown in the documentation found here. However when I run Get-PackageSource it returns PSGallery and ...
1
vote
0answers
65 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 ...
2
votes
1answer
104 views

cUrl for an HTTPS address/domain times out unless previously accessed from browser

I've lost a couple days to this problem and hope it sparks a thought from someone. I am integrating several systems together using Powershell scripts. One of the two services I am connecting to ...
2
votes
1answer
50 views

Need to format power shell output

I am pretty new to powershell and have been trying various ways to split the results from the following powershell script I found but have had no luck. At the moment the script list everything in 4 ...
6
votes
1answer
159 views

How can I generate a list of the security groups a set of users belong to?

I have been asked to generate a list of the security groups (so specifically not the distribution groups) that a list of approximately 50 users belong to. I have a list of users, users.txt that ...
2
votes
2answers
52 views

Find last run defrag WMI or Reg key

I am trying to discover if there has been a defrag run on our servers. To save myself going to each one and loading the defrag program and checking the "Last Run" column I thought WMI might have this ...
0
votes
2answers
43 views

Pipeline input to functions - Write-progress and Alias

I'm currently working on a script to gather a whole lot of information from computers in a domain. As I want to show how far it has come along (the task may run for hours or minutes) I wanted to use ...
1
vote
1answer
34 views

Give users access to Set-Mailbox command to change -ProhibitSendReceiveQuota -Prohibit SendQuota and -IssueWarning in Exchange 2010

Is it possible to give users access to Set-Mailbox command to change -ProhibitSendReceiveQuota -ProhibitSendQuota and -IssueWarning parameters on every mailbox on Exchange server 2010 without giving ...
0
votes
1answer
77 views

Exchange Powershell - Creating Distribution Groups

I'm trying to add some new distribution lists to exchange using the below. C:\>Import-CSV "c:\external.csv" | foreach {New-DistributionGroup -Name $_.name -Type $_.Type} I've created a CSV file ...
0
votes
0answers
18 views

connect-nacontroller - slow connection

I've recently started working with Powershell and the Netapp Data-Ontap Module V 3.0 When running 'connect-nacontroller', there is a very long pause before the connection is made and I am able to ...
1
vote
2answers
122 views

Getting list of users indirectly members of an AD group through LDAP

I'm having a bit of a problem with LDAP search that should specify whether a user is a member of a given AD group or not (recursively). Basically, what I'm doing is issue a LDAP search with the ...
0
votes
3answers
58 views

AD Management via powershell on 2008 enterprise

windows server 2008 enterprise, without hyper-v x64 We have a client server that I am trying to automate some functions on using power shell directly on the server. I have the gateway service ...
0
votes
1answer
77 views

Unrecognized element 'ProviderOption' when trying to use Powershell Set-WebConfigurationProperty

I am trying to build a Powershell script to automate connection string changes to our deployed web applications. I am trying to use the WebAdministration command Set-WebApplicationProperty but am ...
0
votes
1answer
45 views

Script for finding users who does not have specific aliases entry - not working

I wrote the below script for finding users who does not have specific aliases entry in the exchange account, but it returns all user in the OU. can someone help. thank you Get-Recipient ...
1
vote
1answer
26 views

no mof generated with composite resource - powershell dsc

I'm having an issue where the .mof file doesn't get generated when using a composite resource in it.The directory gets created fine and no errors are shown. It might be a simple issue to some fresh ...
0
votes
2answers
56 views

powershell check windows update on a server

We have some 1000 + servers, we are doing monthly patching activity. i need to check the patches are updated on the servers or not, is it possible to check based on the Microsoft Security Bulletin ...
0
votes
1answer
58 views

Get login name using email address with Powershell

I need a powershell script, to get login names using the e-mail address. i am having a note with e-mail address of some users. I want to get login IDs and account information of the users in the ...
0
votes
0answers
29 views

Logman user switch confusion

I'm setting up a powershell script that installs a logman counter on several servers that are in dire need of some performance monitoring. The documentation states that the -u switch works with ...