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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
74 views

Task scheduler - run whether user is logged on or not

I am trying to run task scheduler on my local pc (windows 10), I have set it up to run a exe file stored on my C drive daily, but it doesn't run when I set it to "run whether user is logged on or ...
Steve's user avatar
  • 1
0 votes
0 answers
36 views

Problems with WinRM

I have a PRTG-Sensor that checks servers' Windows Updates Status. It gets automatically created with a template, normally it should work fine. We have 94 of these sensors running, and one won't work ...
brettkanker's user avatar
0 votes
0 answers
27 views

I need to only get all active users in a Security Group, i can list all users but i get both active and inactive users

Need help to correct the scipt. The group FA-xxx-yyy-zzz has loads of users and undergroups in it. This what i figured out so far is: Get-ADGroupMember -Identity "FA-xxx-yyy-zzz" -Recursive |...
Sami Metsokumpu's user avatar
0 votes
2 answers
86 views

Powershell script : Set-ADUser update email attribute samaccountname variable

I'm in need of a Powershell script that will edit all users email attribute within a specific OU in Active Directory. The code below searches for the correct OU and edits the users email attributes ...
jhavig's user avatar
  • 11
0 votes
1 answer
62 views

Script to cleanup Windows.old remotely

Problem: A lot of older workstations on our networks are running out of hard disk space and I am looking for ways to stream-line the process of cleaning up some space. I understand I can use Disk ...
PedalTech's user avatar
0 votes
1 answer
51 views

Find issued certs based on signing templates

I am looking for a way to query on issued certs from my CA based on their signing template. Here is what I start using (based on PSPKI 4.0.0 module); $AllCerts= Get-CertificationAuthority -name ...
mandg's user avatar
  • 23
0 votes
0 answers
19 views

How to create and manage a new DCOM object via batch or powershell

Win+R. dcomcnfg > I need to register a new dll using this tool as a COM. I can do this manually. But I have a lot of WS. regsvr32 is not enough. The COM App need to exist in dcomcnfg So, can it be ...
Inkvee's user avatar
  • 1
0 votes
0 answers
35 views

Windows Server: Email Notification when a user executes an exe?

I need some way to send and email notification when a user logs in to a remote desktop and executes a exe , i need to send an email that exe was run... Is this possible in powershell ? Should i add ...
abmv's user avatar
  • 133
-1 votes
0 answers
20 views

How to remove residual files for uninstalled old version of Windows Store app using SCCM

I uninstalled some old version of windows store apps using PowerShell commands but unfortunately the scrap file is still on the machine in Windows App folder under program file and registry. How can I ...
Salim Jayhood's user avatar
0 votes
1 answer
48 views

WMI query or Powershell command that retrieves a sampling of historic CPU and memory usage for Hyper-V

I need to programmatically retrieve a sampling of recent CPU & memory usage on a Hyper-V system, as seen by the guest OS. By recent, I mean within the last few mins. I can't customize the target ...
Suzette S's user avatar
-2 votes
0 answers
20 views

How to process POST request in IIS to run specific PowerShell scripts in response?

What is the simplest way to make IIS run certain PowerShell Scripts in response to certain things? Say, I invoke the following PS on the client side: $json = @{ "code" = "...
user2838376's user avatar
1 vote
0 answers
28 views

Set-DnsServerCache: Failed to connect to DNS server

I am trying to change my computer's DNS cache max time to live. It is not in any domain, I am the full administrator on the computer - built-in administrator account + disabled group policy "Run ...
Inshallah's user avatar
0 votes
1 answer
47 views

powershell script to remove shared printers if exist

sorry for ask guys but need some help to get this. I got some printers installed in many computers like \server\printer. I was thinking to remove them with a powershell script but cant get it done. I ...
RobertDL's user avatar
0 votes
1 answer
49 views

Backing Up Forwarded Events

I have created a simple test two liner ps script to backup parts of my event logs and the only one I can't backup is the forwarded events, is there a reason for this? The other logs back up fine with ...
Davids Learnin's user avatar
0 votes
0 answers
32 views

Turn off Focus assist via GPO not working as expected

Is there a standardized way to turn off focus assist centrally since i am trying to display balloon tips and toast notifications for applications and windows updates being deployed from sccm software ...
john zuh's user avatar
5 votes
0 answers
66 views

Powershell: How to read secure strings from textfile with windows service

I saved credentials of my vSphere environment to text files with the Powershell ConvertFrom-SecureString. I want to use this credentials in my powershell script using the following command: $...
TheWhiteJoker's user avatar
0 votes
0 answers
30 views

Windows Server - create firewall rules from network trace?

A good basis for firewall rules would be Zero Trust - only allow what is needed. But in many cases, you do not know all the needed rules for a server connection. As a result in many evironments, the ...
David's user avatar
  • 1
0 votes
2 answers
92 views

Export to file Get-ACL for AD Computer Object then import later using Set-ACL

I could use some help. My Active Directory is 20 year old, its about to start buying legal alcohol and god knows where it's going from there... All joking aside, Exchange has ravaged my AD DACLs. To ...
Eric Weintraub's user avatar
1 vote
0 answers
21 views

ISO not booting using powwercli

Using below codes I am able to mount ISO to the CD drive of a VM and change the BootOrder of the VM $CloneVM = Get-VM -Name "999_SW999OSTest_Clone" $IsoPath = "[NPROD_LUN-01_DEV_3333] ...
snehasish nandy's user avatar
1 vote
2 answers
60 views

Odd behavior between Outlook client-based automatic reply forwarding and Exchange Powershell

At my current company we're running an on-prem Exchange 2016 email server, and when we have to manage email forwarding for employee absences in certain departments that need coverage, we have users' ...
Billie Kincaid's user avatar
0 votes
0 answers
152 views

Can't Update Active Directory-Schema

I want to update the AD-Schema with the command Update-LapsADSchema, however it threws an exception: "The user has insufficient access rights" The user I'm using for this task is a member of ...
surfer's user avatar
  • 1
0 votes
0 answers
94 views

How can I get all folders associated with an Active Directory group using powershell or something similar?

At my job we have hundreds of AD groups that we add users to to give them access to folders. For each folder/group of folders we give access to there is supposed to be a read, write, and modify group. ...
Anon's user avatar
  • 13
1 vote
0 answers
67 views

How do I get a complete list of all Windows AD computer accounts that are part of a cluster group in my AD domain?

Regardless of whether they are active nodes or passive nodes, how do we get a list of all Windows AD computer accounts in a cluster group? Using the PowerShell module: https://learn.microsoft.com/en-...
Senior Systems Engineer's user avatar
1 vote
1 answer
333 views

runas vs Start-Process - no keyboard (or any at all) input in the console open by Start-Process

I want to open a console using credentials of someone else. Normally I do it with the runas command: C:\> runas /user:$(cat ~\.ssh\ek | select -first 1) pwsh Enter the password for ***: Attempting ...
mark's user avatar
  • 735
0 votes
0 answers
83 views

Test-SRTopology Fails to Create CIM Session to Local Host

We are trying to setup Storage Replication between two brand new Server 2019 VMs. I have followed all the steps in Microsoft's guide (https://learn.microsoft.com/en-us/windows-server/storage/storage-...
Caynadian's user avatar
  • 444
1 vote
1 answer
116 views

Get all computers running specific Windows OS

I'm currently in the process of upgrading all Windows 2012R2 and 2016 servers to 2019. I would like to run a Powershell cmdlet that will get all the computers on the domain that are powered on, and ...
jhavig's user avatar
  • 11
0 votes
1 answer
40 views

Start exe as current logged in user

i am creating exe shortcut on Windows startup folder while installing application. It was automatically starts on Windows start and restart. I want check on every 5 mins whether the exe running or not....
Hisanth's user avatar
0 votes
1 answer
42 views

Need help on creating a script for output files size to a text file

i want to create a script that will output the size of 3 files to a text file. and that the sizes will be shown in GB's. How do I accomplish this?
inadmin's user avatar
-2 votes
2 answers
108 views

Powershell - Assign random number to AD "Telephone" Tab "IP Phone" field

I need help with writing a PowerShell code I want to generate a Randon number (password) and assign that number to all active users in active directory. The random number will be place on the "IP ...
Louis Philippe's user avatar
1 vote
1 answer
453 views

PowerShell commands to manage NPS Radius policies?

Are there PowerShell commands for managing NPS RADIUS policies? I see commands for RADIUS clients (Get-NpsRadiusClient; etc), but nothing for the policies, I can't find a command to create the NPS ...
user3271408's user avatar
0 votes
2 answers
32 views

Spot instance windows auto login in User Data using Boto3

I want to launch a Windows spot instance on AWS with a specific AMI and launch the instance and run PowerShell command. The problem i am facing issue is that, when the instance is launched, it shows &...
dextoruz's user avatar
1 vote
2 answers
74 views

Map Mailbox object and MailboxStatistics object and ReducedRecipient

There is three cmd-lets in Exchange EMS: Get-Mailbox - returns object type [Mailbox]; Get-MailboxStatistics - returns object type [MailboxStatistics]; Get-Recipient - returns object type [...
Posix's user avatar
  • 11
0 votes
1 answer
26 views

Powershell: creating functions (or aliases) for system commands

I am trying to make it easier to run certain things with certain users from powershell. So first I calculate username and domain needed to run a specific command, which is no problem. But then I want ...
MofJinB's user avatar
1 vote
1 answer
98 views

Update JSON Payload using Powershell and Nutanix API

I'm currently writing a script that allow to update Nutanix VM Categories. Categories format is key:value and a VM may have no categories, 1 or multiple. Process to do that is quite simple : first I ...
motorbass's user avatar
  • 343
0 votes
0 answers
86 views

Powershell Linux - Unable to install Module in Azure Ubuntu

I'm trying to install the AZ module in the Ubuntu powershell of an Azure Linux server. However, the powersheel could not find the PSGallery repository. I suspect the DNS record retrieved by the server ...
Nash A's user avatar
  • 1
0 votes
1 answer
1k views

Windows Server 2019 Cannot Install .NET 3.5

crosspost Microsoft IT Pro Tech Community crosspost r/sysadmin Windows Server 2019 Cannot Install .NET 3.5 I am running Windows Server 2019 (Version 1809, Build 17763.4499) and I cannot install .NET ...
Paul Boyer's user avatar
0 votes
0 answers
48 views

VMware Guest VM Join My Own Domain With Netdom Fails ""DNS name contains an invalid character"

Trying to join a VMware guest VM to my domain. I'm running the Powershell script from one of my other guest vm's in VMware vCenter. I've tried changing the $Domain variable to other string names ...
Mark Matlock's user avatar
1 vote
0 answers
47 views

Why does Application event log get cleared when I remove this custom even log

I am using powershell cmdlets to create a new event-log, register a source and log events. I experience some unexpected behavior. I created a new log with an arbitrary name by issuing the command: New-...
Krzysztof Jabłoński's user avatar
0 votes
1 answer
352 views

Join domain while running PowerShell as system and specifying domain join credentials

I have a WORKGROUP machine that I need to join to the domain. I can access PowerShell on the machine as System using the installed RMM tool. But I get an error whenever I try to Add-Computer from the ...
Dave's user avatar
  • 51
0 votes
1 answer
103 views

How to change SQL Server sa password as part of ec2 userdata

I'm provisioning some development EC2 instances running Windows Server, with SQL Server installed. I use a custom Amazon Machine Image with the configuration we need, but as part of the provisioning ...
data princess's user avatar
0 votes
1 answer
158 views

Azure Powershell script to clone NSG rules across subscriptions in the same Tenant

I need some help with a powershell script clone NSG rules from a particular NSG in 1 subscription to a NSG in another subscription. I have a script that accomplishes this if both NSG's are in the same ...
shaolinmaster827's user avatar
0 votes
0 answers
99 views

GPO: Startup PowerShell script on multiple OUs only running once

I have a weird issue with a PS script which should run on startup of a computer. This script is configured identical on three levels (OUs) only different parameters. Depending on for which hosts it's ...
nightmare1942's user avatar
0 votes
1 answer
169 views

How to add persistent IP address in powershell

Why can I successfully add an IP address with this command New-NetIPAddress -IPAddress 192.168.0.168 -PrefixLength 24 -InterfaceIndex 34 but the same command fails for persistent address New-...
jackhab's user avatar
  • 781
1 vote
1 answer
109 views

Windows OpenSSH Match Exec string with embedded quotes

Under Openssh for Windows, is there a way to specify an exec string for powershell with embedded quotes? It's made complex by the fact that a multiword command must be quoted, and I can't figure out ...
Autumn's user avatar
  • 123
0 votes
1 answer
172 views

Event 1202 when trying to run a scheduled task GPO under NT Authority\System

I'm trying to get a barcode font installed on machines for a enterprise application. The GPO is being served from a Windows Server 2019 Standard version 1809 OS build 17763.4252 server. The GPO in ...
Liam Chaney's user avatar
0 votes
0 answers
120 views

Why are "wmic diskdrive get size" and "(Get-Disk).Size" returning slightly different values?

As you can see, the following commands provide slightly different output. Why? I was expecting them to be the same. There is a 2.66MB difference between the two. How can I get the values from "...
Ingram's user avatar
  • 153
0 votes
0 answers
36 views

Logging hash of signed PowerShell-Scripts

I use signed PowerShell scripts within my infrastructure and log all PowerShell activity via Windows EventLog. Sadly it seem that windows does not log a hash or fingerprint of signed scripts or even ...
user1667906's user avatar
0 votes
0 answers
149 views

PnP - Sharepoint site members and site Owners

I'm trying to pull site 'members' along with 'department details, 'job title' as well as other attributes per site. The results pretty confusing as I'm unable to differentiate between site 'owners','...
Lightman's user avatar
0 votes
1 answer
134 views

How to set-mailboxfolderpermission with import-csv

I want to import bulk zoom from CSV file. The csv file format: name,email,capacity And I create the room with the script as below: $roomlist = import-csv roomlist.csv foreach($room in $roomlist){ ...
alvinshih's user avatar
0 votes
1 answer
166 views

Format date in the output of a PowerShell query

PowerShell nubie question. How do I format the date in a PowerShell query result? Example command: get-adcomputer -Filter {operatingsystem -like "Windows 10*"} -Properties ...
JPoole's user avatar
  • 125

1
2 3 4 5
82