Questions tagged [powershell]

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, and takes over from previous languages such as VB Script.

1,020 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0 votes
1 answer
454 views

SCCM application detection - encrypted powershell script

When using SCCM powershell script detection for an application deployment type - is it possible to encypt the script/obscure such that it is unreadable to SCCM console users? I'm trying to solve a ...
yobbo's user avatar
  • 11
0 votes
1 answer
141 views

Export object location from CSV

I need to export the object location of servers from a list. I have tried using the following script, but it only checks the mentioned OU, how can I search the entire domain and export the canonical ...
JJJJNR's user avatar
  • 870
0 votes
1 answer
57 views

automatically logoff interactive user sessions for workgroup windows servers

I have windows application servers that are not domain joined and any changes I make to them must be doable via a locally run script (not a remote command) that is executed when they are provisioned ...
red888's user avatar
  • 4,243
0 votes
0 answers
222 views

Windows Server 2012 R2 fails to load Remote Desktop module in powershell

I have my citrix master image that i'm using to test a script meant for a staggered reboot for my target devices. Need to import remote desktop module for the script to work. For some reason i cant ...
chetankini's user avatar
0 votes
1 answer
211 views

How can I create a file screen for each path in this variable?

I have a script that scans a server for drives that contains shares. After that I need it to create a file screen from a template that is already created with the same script, that part works fine. ...
veel84's user avatar
  • 288
0 votes
1 answer
223 views

Cloudberry powershell

I am trying to automate the upload of files to Glacier using Cloudberry Explorer's PowerShell snapin but cannot seem to copy files to my preferred destination. For some reason, the source directory ...
MRodz's user avatar
  • 1
0 votes
1 answer
143 views

Users created using new-mailbox script on exchange shell are disabled by default

I've done this many times before and I don't recall hitting this problem, however I'm creating mailboxes on exchange shell using new-mailbox and the accounts which are created in AD are all disabled ...
John's user avatar
  • 541
0 votes
0 answers
109 views

Set Windows2012R2 resolution remotely

I am trying to set the graphic resolution remotely. I cannot use the Set-DisplayResolution, since it does not work with Windows2012R2. I can use the system32 utility setres.exe to do it locally, but ...
MaPi's user avatar
  • 213
0 votes
1 answer
483 views

Using PSSession, Not able to run commands on azure server

Still trying to figure out how to automate a build of an azure server, and install software on it after the build. The template referenced is our own version of the one from used is based off of the ...
Greg P's user avatar
  • 121
0 votes
1 answer
92 views

Find permission of specific account and owner to replace with new account

Using Windows 2008R2. I have an ad account "fileadm" which have some permissions of many folders and files and for some it's a owner. I need to replace this account with another account (with the same ...
puffydee's user avatar
0 votes
1 answer
315 views

Scheduling a task or job with credentials to run after AD promotion start up

I am installing a new VM lab, few windows 2016 servers and AD forest. Part of the lab is installing a DC in the new forest. I have no issue with the feature installation and promotion. My problem - I ...
Pixel's user avatar
  • 146
0 votes
1 answer
379 views

AWS + S3 - Linux downloads, powershell stalls?

I've set up an S3 bucket. From a Linux host, once I create a config and credentials file, I can do: aws s3api get-object --bucket <mybucket> --key <myfile> /root/<myfile> and ...
Tom's user avatar
  • 136
0 votes
1 answer
950 views

IncludeInvocationHeader not working with Start-Transcript

I'm working with a script that parses out a Windows Powershell transcript. The script is dependent on the ... ********************** Command start time: 20170426095605 ********************** ......
BurningKrome's user avatar
0 votes
1 answer
2k views

Url Rewrite Rule needs to disabled and enabled to IIS

I am automating the creation of a URL Rewrite in a testing environment. I am configuring it using Powershell in IIS 8.5 Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -location '...
Oliver's user avatar
  • 161
0 votes
0 answers
1k views

How do I overcome an "Insufficient winsock resources" message that prevents PS Get-ADUser from running

My account is a domain admin, I often log onto a particular server in our network (not the DC), and until recently I could query AD with PS commands, e.g. Get-ADUser crm.webserver -Properties * and ...
colinp_1's user avatar
0 votes
1 answer
470 views

Exchange 2007 export CSV of all external email addresses

A customer asked us the somewhat strange question to make an export off ALL the email addresses their company has ever mailed with. Not the addresses of their own mailboxes, but all external ...
NLuser's user avatar
  • 45
0 votes
1 answer
496 views

Desired State Configuration HTTPS Pull Site Doesn't Work

I've created a domain certificate for my DSC web pull server (issued by my internal CA) and retrieved the thumbprint. I exported the certificate from inetmgr and installed it on the pull server (both ...
Shiffle McDoobles's user avatar
0 votes
0 answers
85 views

AWS and Powershell in a Lab (sub-account) of a primary AWS account

This is a little esoteric, but I need help folks! So I have a corporate AWS account that holds my user permissions. The corporate account has a sub-account that is housing all Lab facilities (so ...
Falcones's user avatar
0 votes
2 answers
237 views

Powershell reporting wrong info for Protected OU

Get-ADOrganizationalUnit -filter * -Properties ProtectedFromAccidentalDeletion | where {$_.ProtectedFromAccidentalDeletion -eq $false} | ft DistinguishedName,ProtectedFromAccidentalDeletion Shows "...
nd34567s32e's user avatar
0 votes
1 answer
919 views

Remoting from a WORKGROUP PC to Domain-Joined PC

I was wondering if it was possible to remote from a WORKGROUP PC to a domain-joined PC, using only the local credentials of the domain-joined PC. I know this is definitely doable through PSExec, ...
JacksonVD's user avatar
0 votes
0 answers
242 views

Understanding exactly why the timestamp was not affected of ad objects

I made a script that takes data from an HR database and populates correlating attributes in AD e.g department, title, manager, location. Since people change titles, departements and/or locations on ...
Matt's user avatar
  • 670
0 votes
1 answer
441 views

Set Skype for Business PIN for all users

I know that the PowerShell command to set a single user's Skype for Business PIN is this: Set-CsClientPin -Identity "User Name" -Pin 123456 This page seems to help: https://technet.microsoft.com/en-...
Matt W's user avatar
  • 101
0 votes
1 answer
823 views

Getting User group members using Powershell

I got a script Invoke-Command {net localgroup administrators} which only work in server 2012 & not in server 2008R2, getting error as mentioned below, even though "WinRM already is set up to ...
V T's user avatar
  • 3
0 votes
2 answers
212 views

Only allow remote command with credentials

I have server A and a server B in the same domain (Windows Server 2012 R2): PS C:\Deployment> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 4 0 -...
lvthillo's user avatar
  • 115
0 votes
0 answers
853 views

Enable-PSRemoting Error

I manage a network of over 100 2008R2 Servers. There is no domain on the network for various reasons. I am running Enable-PSRemoting -Force on all the servers. Some of them are running just fine, ...
Ari Winokur's user avatar
0 votes
1 answer
31 views

. .\Variables.ps1 returning CommandNotFound

I am trying to call a variable called $company from one powershell script called "Variables.ps1" into another powershell script in the same folder called "edit_website.ps1" at the top of "edit_website....
xjacksssss's user avatar
0 votes
1 answer
1k views

What Security Implications Does WSMan "TrustedHosts" Have?

I found that WinRM requires TrustedHosts (in WSMan:\client) to be set to run remote PowerShell commands. I am unable to find official documentation on the security ramifications and risks of trusting ...
Joel May's user avatar
  • 189
0 votes
0 answers
556 views

Windows 2012 - Powershell v4 update hosts file without restarting

I wrote a Powershell script where I update hosts file at runtime: add entries, clear entries. An example of what I am doing: Import-Module 'Carbon' #Carbon module functions Reset-HostsFile #No ...
Vinc3nt's user avatar
0 votes
1 answer
365 views

Windows scheduled task running slow

I have a script which among other things, updates a CName record in DNS. It updates the same record on multiple DNS servers, one at each site as we can't wait for replication. The first time the Get-...
Stuart475898's user avatar
0 votes
1 answer
565 views

Why isn't PSReadLine part of my powershell?

Why isn't PSReadLine part of the default modules of my powershell? How can I get all the default modules? ⨯ idror@TLV-WPJ03  ~  $PSVersionTable.PSVersion Major Minor Build Revision ----- -----...
IttayD's user avatar
  • 1,107
0 votes
2 answers
716 views

Scheduled Powershell script occasionally dies midway through

I have a few powershell scripts that are scheduled, and they usually run just fine (both as a scheduled task, and when run manually) I've got an issue where occasionally, they just stop working ...
basementjack's user avatar
0 votes
1 answer
131 views

powershell exchange script output only works when typed manually

I'm typing the following command in exchange 2010 EMS and it works when I run it interactively. $a = Get-MailboxDatabaseCopyStatus -server theName | fl name,activedatabasecopy,status,...
Jon's user avatar
  • 339
0 votes
0 answers
2k views

Set Multiple IP Addresses For DHCP Option 6 DNS Server Using Netsh

I am trying to set two IP addresses for option 6 DNS server using this code: $serverIpAddress = '11.12.13.14' $subnet = '11.12.43.33' $value = '11.12.74.21,11.12.74.22' netsh dhcp Server $...
David Klempfner's user avatar
0 votes
1 answer
650 views

How can I use Exchange Management Shell to set the FirstName and LastName on multiple mailboxes?

I imported 100+ new mailboxes using Import-CSV and New-Mailbox and the Name and DisplayName fields have been populated correctly however seems I missed setting the FirstName and LastName fields. The ...
John's user avatar
  • 1
0 votes
0 answers
520 views

exchange get-distributiongroup powershell issue

I need to add a member to about 50 distribution groups. I have the list of groups in "display name" format. According to documentation the -identity parameter of get-distributiongroup takes pipeline ...
Jon's user avatar
  • 339
0 votes
1 answer
219 views

Backup powershell script pauses until i press space

I made a script to export all mailboxes ( as secondary backup for my Exchange 2013 Server.) The script basically gets all the mailboxes from a list in a text file and does a for-loop going through ...
nando's user avatar
  • 111
0 votes
0 answers
2k views

Odd behavior using WinRM via powershell, works sometimes and other times does not

Been setting up Powershell Remoting for all of our client machines (Pushed out GPO last week) and I can Test-WSMan on pretty much all of them and I get a nice expected response. Now on one of our ...
TofuBug's user avatar
  • 101
0 votes
1 answer
149 views

How to get Adusers which are disabled of an defined company and shows the groups where this users are member of?

I have the following problem with my powershell script. With MemberOf I d'ont see all groups. I think the output is too long for the field..... How can I resolve this problem? Any Help is welcome........
dj-dali's user avatar
0 votes
0 answers
116 views

Write-Eventlog to create events

I try to create events with similar codes like this: Write-EventLog -LogName 'Windows PowerShell' -Source PowerShell -EventId 12345 -EntryType Information -Message 'Script started' Creation process ...
appkovacs's user avatar
0 votes
1 answer
2k views

(Auto) Searching for every SMB Share in Network and List which has ,,Everyone" Read + Write access

Is there an comfortable way (example with PowerShell) to do a network scan for every share and list the shares which has setup that ,,Everyone" can Read and Write.
RogerSik's user avatar
0 votes
1 answer
544 views

Windows Server 2016 : using Restore-WebConfiguration

I'm trying to use the powershell cmdlet Restore-WebConfiguration on Windows Server 2016, and I'm getting this error: PS > Restore-WebConfiguration name get-webconfiguration : Retrieving the COM ...
Warren P's user avatar
  • 1,195
0 votes
0 answers
260 views

If an AD attribute appears in one LDAP tool, and not the other, what can be the cause?

I'm using the same userID, LDAP connection string to bind to an LDAP server and fetch information. Tool #1 exposes the msExchMailboxGuid consistently and reliably. Tool #2 (.NET) doesn't expose the ...
makerofthings7's user avatar
0 votes
1 answer
2k views

can't open new powershell session from one server to another

I am trying to open a powershell session from one server to another. I can open sessions to servert1/2 which have the same configuration as far as I can tell. trustedhosts are the same, same user/pw ...
C.Rosenstadt's user avatar
0 votes
1 answer
131 views

PowerShell printing event not being triggered

Thanks in advance for any help. I'm trying to use PowerShell V5 to generate an event in which I can trigger an action. In the example, I'm just trying to write-output as my action. When I print, the ...
Tim Haintz's user avatar
0 votes
1 answer
2k views

Powershell task from Scheduled Tasks keeps running forever

I've created an scheduled task to call a webpage using PowerShell, but I don't know why it is not going to be ended after execution, and the status remains "Running". The action is "Start a program", ...
Ahmad's user avatar
  • 103
0 votes
0 answers
141 views

Mystery display -- Missing portions of server feedback in Windows PowerShell

What's up with this? I'm trying to use Windows10 PowerShell to interact with a Meteor application. I'm having a heck of a time displaying feedback from the server thru the PowerShell. Here's a ...
zipzit's user avatar
  • 121
0 votes
1 answer
1k views

Set PowerShell "Plugin\Microsoft.PowerShell\Quotas\MaxMemoryPerShellMB" using Group Policy

I want to apply the following PowerShell settings on many servers: Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 12345 Set-Item WSMan:\localhost\Plugin\Microsoft.PowerShell\Quotas\...
EM0's user avatar
  • 329
0 votes
1 answer
37 views

New-ModuleManifest does not prompt for standard keys

On Windows 10, using PowerShell 5.0.10586.494 the New-ModuleManifest cmdlet just returns after prompting for the file path. This goes against the documentation. How to Write a Module Manifest https:/...
Luke Puplett's user avatar
0 votes
0 answers
538 views

NTFS ACL discrepancy in powershell

I have a case, where a user once had access to a directory and that user has been removed now. In fact their account has been deleted out of the AD entirely. Typically when one sees a user deleted, ...
Sabre's user avatar
  • 445
0 votes
0 answers
241 views

How to install and use Windows Assessment and Deployment SDK on Windows Server 2008 R2?

I've recently installed the Windows Assessment and Deployment Kit (WADK) on Windows Server 2008 R2. I've used the installer provided by Microsoft here: https://www.microsoft.com/en-ca/download/details....
Alex Marshall's user avatar

1
15 16
17
18 19
21