Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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, ...

0
votes
1answer
25 views

How do I remove an IPAddress that doesn't have an adapter

I have 4 results (2 IPv4, 2 IPv6) when I query Get-NetIpAddress that do not have a corresponding network adapter. What are these addresses and how can I remove them? I have tried to Remove-...
0
votes
1answer
21 views

Powershell Invoke-Command works when run manually, but not when in a script

I am building a script to remotely install the PSWindowsUpdate PowerShell module, open the correct firewall ports, and then run a command to install waiting updates. In order to install the ...
0
votes
1answer
26 views

Powershell script won't restart on failure

I'm running windows 10 pro. I have a powershell script that starts every day at midnight and runs all day. It's controlled by the Task Scheduler. The script itself works fine and in the event of an ...
2
votes
2answers
32 views

Active Directory Password Reset Enforce Password History

I have a requirement that allows a user to reset their password to what they would like. However, when doing it through Powershell Set-ADAccountPassword function and using the reset parameter, it ...
2
votes
1answer
28 views

Powershell annoyingly asks me to confirm y press with enter. How to confirm with just y click?

For example, I have a remove command: ls|rm -Confirm For every single file, I have to press 'y' and enter sequentially. In most shells, it's enough to press just 'y'. How to avoid it in the ...
0
votes
0answers
23 views

Cannot uninstall WMF 3.0 (KB2506143) on Windows Server 2008 R2

In order to install WMF 5.1 on Windows Server 2008 R2 Standard, I need to uninstall WMF 3.0 first. After successfull uninstall, the update always reinstalls itself after a reboot. I uninstalled it via ...
0
votes
0answers
26 views

Retrieving user logon and logoff information

I'm trying to get information about how much a group of computers is getting used, so I can potentially re-purpose them. I wrote a PowerShell script to get logon and logoff information from the Event ...
0
votes
1answer
19 views

Get-DnsServerForwarder in WinSrv2012R2

Can anyone tell me why when I execute this Powershel cmdlet I can see a DNS forwarder that I inserted earlier (also using PS) but I can't see it on the DNS management console? PS C:\Users\...
0
votes
0answers
22 views

error writing proxy. (87) incorrect Parameter in powershell while trying to set proxy

Welcome I've come up with a problem: I^ve started powershell as an administrator and I'm trying to set my proxy with this command: netsh winhttp set proxy "http://proxy_url:port" Sadly the shell's ...
1
vote
1answer
18 views

Enabling mailbox access auditing in Office 365 with MFA

Microsoft Security & Compliance center with Microsoft Secure Score has a long list of good, excellent and non-relevant security advises. Sometimes they seem a bit incompatible together... ...
-1
votes
0answers
18 views

WDS PowerShell console [on hold]

I have Windows Server 2012 R2 with the WDS role activated on it. I am working on a script in PowerShell, but that very script just freezes after a while. I'd like to have a console to output what ...
1
vote
2answers
20 views

AWS PowerShell Significantly Slower the AWS CLI

I'm having an issue in that a PowerShell Script takes 10 times as long as a batch file to download files from AWS S3. I have an existing batch file script to move files from one S3 Bucket to another,...
0
votes
0answers
21 views

Get-WinEvent: unauthorized errors while filtering by ProviderName

I'm using PowerShell (Get-WinEvent) to get the restarts from a server and I'm getting an unauthorized error only while applying the "ProviderName" filter: $logNames = @("Application","System") $...
0
votes
1answer
18 views

aws s3 cp files from the root of a subdirectory without getting subfolders as well? Powershell

s3://bucketname/yyyymmdd/foo/bar I have some files in the root directory and I want to copy them. I do not want to copy any subdirectories to the root (foo). I'm trying this in powershell: aws s3 cp "...
3
votes
1answer
56 views

Add columns to existing PowerShell object

I am attempting to add on to an object before displaying it with an Out-GridView. I am doing the method below however get an error message. I'm not strong enough in Powershell objects to understand ...
0
votes
0answers
26 views

How to run a script/command at only the “first” boot once on Windows Server 2016?

I've been looking around everywhere but couldn't find anything relevant. I have a pre-configured Windows image that I would like to deploy on a huge number of VMs and I want a specific script to run ...
0
votes
1answer
26 views

Powershell: script doesn't return all rows

I would like to add Department AD property to all users exported from an application. There are a lot of app users who can't be found in AD. This script returns Department to the users found in AD ...
4
votes
1answer
79 views

Powershell: Configure a static IP on an unplugged NIC

I'm trying to find a way to configure a permanent static IP on Windows 10 IOT devices with their Nic unplugged. I have a script that needs to be run on the devices before they're in place and part of ...
0
votes
1answer
30 views

How can I enable, scan, and disable windows defender from inside a scheduled task?

If windows defender is disabled can you later (through a script) enable, run a scan and then disable it via a powershell script that is invoked as part of the scheduler? If this is possible then ...
1
vote
3answers
51 views

What do Windows Defender Powershell ThreatAction enums map to?

I'm looking at a default Defender configuration in Server 2016. I'm not sure how to discover what these '0' mean for the ThreatDefaultAction: HighThreatDefaultAction : 0 ...
0
votes
1answer
48 views

PowerShell to list logs files on recurse folder then create zip monthly using 7zip on it's directory

Im trying to create script to list logs then compress it monthly and put it on the same directory. We have many logs subfolder inside C:\TestLogs\ Example Script that i have # set folder path $...
0
votes
1answer
58 views

WMI E_ACCESSDENIED errors when attempting to remotely rename computer via PowerShell

I am trying to run a script to rename remote computers via PowerShell. The problem I'm running into is that I'm getting the following error: Rename-Computer : Cannot establish the WMI connection to ...
0
votes
0answers
28 views

UAC with install automation: SCCM or Powershell Remoting

I am trying to get my head around the best approach for managing UAC. What I WANT: Regular users are not Local Admins and have somewhat elevated UAC. Special "Install" user is Local Admin but not ...
0
votes
1answer
35 views

Unused Office2016 ProPlus subscription licences

In an effort to help reduce costs for the NFP organisation I work in, I'm hoping to find out which staff or volunteers have been assigned an Office2016 ProPlus subscription licence but not used it. (...
0
votes
2answers
74 views

Powershell script to stop IIS AppPool recycling

By default a new app pool will want to recycle itself on a regular time interval every 1740 minutes. I want to clear this setting so the IIS never recycles it.
0
votes
1answer
41 views

Add new column to the existing one PowerShell

I have list of the servers, for them I'm used commands Resolve -DnsName, this command has different parameters and to receive all the data that I need (NS, MX, CNAME, A) records, I need to make ...
0
votes
0answers
39 views

GroupName is empty when I try getting the details of all users from the Active directory?

I have the below code where I'm trying to get all user details information existing in an active directory. $path = "C:\ServerDetails" $LogDate = get-date -f yyyyMMddhhmm $csvfile = $path + "\...
0
votes
0answers
7 views

The resulting output file sizes of Powershell GetDatastoreItem command are smaller than the associated input file

The resulting output file from a PowerCLI GetDatastoreItem command produces a file that is smaller than the input file. This is especially true for vmdk files. The output file is about 75% the size ...
0
votes
0answers
23 views

How to enable or install get-partition or other commands from windows 2012 in win2k8

OS : Windows 2008 R2 Error: The term 'Get-Partition' is not recognized as the name of a cmdlet, function, script file. storage modules not available in this path C:\Windows\System32\...
0
votes
1answer
75 views

In Powershell, how to check drive space on remote server with non-admin account?

I work in an active directory environment with many servers. I have a user account that I would like to use to check the status of other servers, without giving this account full administrative access ...
0
votes
2answers
130 views

Copy files to network drive with powershell script and task schedule

I have powershell script that is copying files from local drive to network mapped drive. Everything works fine when i run this script via powershell but when i run this script with task scheduler it ...
0
votes
0answers
18 views

Insert several servers IP via txt/csv under SMTP on IIS 6 (Windows Server 2012) via shell/vbscript/anything [duplicate]

We would like to import several servers authorized IP's to send mails to the relay field on IIS 6 (WS2012). Do anyone have a viable way to do it? Many scripts were tested, none successfully.
0
votes
0answers
41 views

Enabling the register in DNS option for a network adapter in Server Core

Environment: Windows Server 2016 Core with DNS server installed (more specifically, this is a Domain Controller, but my question is only regarding DNS). Problem: The Best Practices Analyzer (BPA) for ...
1
vote
1answer
46 views

Check whether user account has password set

In standalone (non-domain-joined) Windows, is it possible to use PowerShell to check if a given local user account has a password set / a blank password? According to https://gallery.technet....
0
votes
1answer
16 views

Get-NetNeighbor for other routers in various sites (Determining active devices connected)

First post here, usually partial to StackOverflow, but this isn't exactly code related so I figured I'd drop here. I'm looking to get the arp table of routers within our network at various sites. I'm ...
0
votes
0answers
26 views

Powershell script, multple groups - listing of members and group properties

With ref to: List All Groups and Their Members with PowerShell on Win2008r2 I am looking for a script which can ready an input file with only portion of group name available, such as, xyx. The results ...
0
votes
1answer
76 views

How to Use PowerShell DSC to Keep Services on Windows Server Running?

I've recently noticed that our Windows Server 2016 VMs on Azure sometimes fail to start some of their services after rebooting the system (for example ADFS, Remote Desktop Broker and others) even ...
0
votes
1answer
69 views

Automate setting Update Server settings for non domain servers

I am trying to automate setting about 40 non domain servers to use a WSUS server. I've read posts like Can I use Powershell to configure Local group policy settings in windows server 2008 r2 and I've ...
0
votes
1answer
28 views

I need to export users from multiple OU to Respective OU names CSV's

I have a script which will collect the users who haven't logged in before jan 2018 list and out put in single CSV. I need the output like OU1 users output goes to ou1.csv, ou2 users output goeas to ...
1
vote
2answers
254 views

Resetting local admin password for a remote computer using Powershell

I'm trying to create a script for resetting local admin password for a remote computer in my organization. I'm pretty new to powershell, and I'm learning most of it by trying and failling in the ...
1
vote
1answer
57 views

PowerShell script on Scheduled Task sends email on some servers but not others

hopefully somebody can help me fathom this as it's doing my head in a little! [I'm new, so please be gentle :) ] I recently set up a PS script to run by Windows Scheduled Task at startup, via batch ...
1
vote
1answer
34 views

How to get infromation about disk location (like in diskmgmt.msc) via Powershell?

could you please help me how to get disk location number which can be found via Disk Management (diskmgmt.msc) for future VMware SCSI Disk devices assosciation via PowerShell or any other native ...
0
votes
0answers
40 views

Applying PowerShell Desired State Configuration to Windows host from Linux control machine

I'm interested in using my Linux work machine to apply DSC configuration to Windows machines. I can find lots about using DSC to manage Linux, but that isn't what I'm interested in, I want to use it ...
0
votes
1answer
44 views

Domain PowerShell Policy

I have created a GPO to enable powershell on our domain PC's. I'm trying to make it more secure and I'm running into an issue with the following settings: *Browse to Policies > Administrative ...
0
votes
0answers
40 views

powershell - get from ad group user name and they group

in my AD I have security group "Citrix" and in this group I have added a lot of groups "Citrix 1", "Citrix 2", and more... in this group has add users. I need to get information with powershell users ...
1
vote
0answers
48 views

How do I use Power Shell to copy folders from local to remote Linux Server

I am trying to make a script that will let me update the files on the server by copying then from local. I made a bash script for this task that works on Linux, but a Power Shell script is also needed ...
0
votes
1answer
44 views

Join Server to Worfkgroup Without Creds?

I am imaging servers from stock AMI's in amazon. For business purposes I have to briefly join these servers to the domain so that I can install some agents before I shut them down, sysprep them, and ...
0
votes
1answer
16 views

Exchange 2010 queue viewer not working in Exchange Management console

I recently agreed to help my works network admin with the exchange 2010 server (seeing as I have experience in 2016 which were migrating to at the end of the year), but when trying to administer it, I ...
1
vote
1answer
107 views

Can DSC be used to configure IIS on a Windows 10 workstation

I couldn't find this on the interwebs and it seems like a obvious use case to me Is it possible run Windows Desired State Configuration / DSC on a Windows 10 workstation? For example, setting up IIS ...
0
votes
0answers
36 views

Powershell -searching thru eventlogs for a specific pattern

I am trying to research IIS service crashing. The eventlog I am trying to research has a very specific message: World Wide Web Publishing Service service terminated unexpectedly. Im trying to list ...