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
0answers
8 views

Can't perform PS Remote

I have to perform psremote from one server to my domain controller. I have enforced some settings via gpo: Allow remote server management through WinRM -> set on enable and i have placed the ip ...
0
votes
1answer
14 views

Docker enterprise installation on CIS AMI of windows 2016 server

I am trying to install the Docker enterprise edition on CIS AMI of windows 2016 server using ansible. I am using PowerShell module for this installation. The code is as below for the docker ...
0
votes
0answers
23 views

Local install of powershell instead of https://shell.azure.com?

I am trying to use Powershell to create VMs on Azure because I cannot find the necessary functionality on the portal (or get it to work). Is it possible to administrate Azure using a local instance of ...
1
vote
2answers
31 views

powershell user data script run on restart of the Windows instance

We have windows servers that do application initialization which takes almost 3-4 hours for servers to be online. So to avoid downtime we use autoscaling group lifecycle hooks. Now we want to shut ...
1
vote
0answers
53 views

Powershell script for EMC unity capcity monitoring

I am preparing a powershell script to export the unity capacity pool details to a csv file. Need a loop to export all the pool details to csv file. The loop should read the used space and total space ...
0
votes
1answer
11 views

Trying to get windows scheduled task state in zabbix

I've just started using the following template to monitor my windows scheduled tasks: https://share.zabbix.com/operating-s...hes-planifiees So it works perfect but the only problem is it doesn't pull ...
-1
votes
1answer
18 views

Powershell command to find a specific txt file, searching all the local drives, except share drives [closed]

Please help. I am new to Powershell and I am trying a Powershell command to find a specific txt file, searching all the local drives, except share drives. Any help is greatly appreciated.
0
votes
2answers
82 views

Powershell script to delete emails from mailbox older than an 7 month or specified dates

I have problem with converting my Search-Mailbox command to another one. If you all know in the future as Search-Mailbox is retired. So I need to use another cmdlet for this command. My working right ...
0
votes
0answers
19 views

Azure ARM template: how to deploy VM and create file on admin's desktop?

I'm using the CustomScriptExtension to execute a PowerShell script as the last step of my VM deployment: "settings": { "fileUris": [ "[uri(parameters('...
0
votes
1answer
38 views

What is the correct way to limit windows event log size?

I'm looking for a the best way to limit the windows event log size using PowerShell or a command line script. I want to run this script during installation of my application to increase the limit of a ...
3
votes
4answers
175 views

Unable to create email alias because it already exists, but cannot find the instance of it

Error: An Azure Active Directory call was made to keep object in sync between Azure Active Directory and Exchange Online. However, it failed. Detailed error message: Another object with the same ...
10
votes
2answers
1k views

How can I tell if a user has more than one computer logging with Outlook?

I have reason to suspect that a user may be accessing their company email using a copy of Microsoft Outlook (or perhaps another email client) from a personal device for the purpose of data ...
0
votes
0answers
24 views

Editing $PROFILE in Azure Cloud Shell

I have setup Azure Cloud Shell, and put my profile script at default $PROFILE location, which appears to be /home/username/.config/PowerShell/Microsoft.PowerShell_profile.ps1 However I noticed that ...
0
votes
0answers
22 views

Get-PartitionSupportedSize without administrator privileges?

Tried adding user to URA "Perform volume maintenance tasks" does not seem to provide access to Get-PartitionSupportedSize cmandlet. Get-PartitionSupportedSize : Access to a CIM resource was ...
1
vote
0answers
50 views

ActiveDirectory Startup/Shutdown PowerShell Script not being executed, failing silently

Environment Windows Server 2012 domain Windows 10 version 2004 client I'm trying to deploy an ActiveDirectory Startup or Shutdown powershell script on a test OU to update VLC Media Player and I can'...
0
votes
0answers
59 views

Prevent User RDP Login When Using a Specific PC (Client)

The ideal situation is preventing a specific user from being able to RDP into a server if using a specific PC. This is a rule I want imposed on a particular PC and nothing else. Other possible ...
0
votes
1answer
34 views

Can't write to ROOT\CIMV2\TerminalServices via powershell

I'm trying to automate installing new SSL certificates onto a Windows Server using powershell. I have most of it done but I have a small issue. When I try to update the Terminal Services SSL cert I ...
0
votes
1answer
30 views

kubectl diff on PowerShell?

kubectl can diff configuration (blog, docs). On Linux, this works fine (WSL, Ubuntu 18, bash). It gives me sensible output similar to the following. $ kubectl diff --filename some-resources.yaml diff -...
2
votes
0answers
48 views

What could cause PowerShell Remoting to use high bandwidth?

I do IT work for an organization that is currently setting up (or letting me set up) an Active Directory domain. Right now, it's still in testing with 1 DC and 1 client. A week or two ago, our switch ...
1
vote
1answer
113 views

Unable to use alias name with powershell

I have created an CNAME alias record (PublicShare) for one of our servers (KWT-SRV01) in Windows Server DNS. Unfortunately i am unable to use it in powershell "-path" attribute. For example, ...
0
votes
1answer
27 views

Powershell returns access denied on non-os files used by IIS site

I am connected as a local administrator using RDP to my WIN2K16 server, and manage it using gui and powershell. Overall I have full control over the machine, and never had permission errors using both ...
2
votes
0answers
72 views

How do I fix 'Missing stored keyset' through a remote powershell session (without also being RDP'ed in)

I'm trying to script the installation of our on-premise CI/CD agent. Part of that is installing some certificates Powershell Import-Certificate -FilePath self_signed_CA.cer -CertStoreLocation cert:\...
1
vote
1answer
50 views

Powershell: unable to create new Hyper-v VM remotely

To simplify our current setup. We have SRV01, SRV02, and SRV03. All Windows Server 2016 with Hyper-V installed and joined to our domain. SRV01 host a shared folder "\\SRV01\VM-ONLINE-STORAGE\Test&...
0
votes
0answers
27 views

Is it possible to install Windows Debugging Tools via Powershell?

I've installed LeanSentry on one of my web servers to try and diagnose some performance issues I've been having. I need to install Windows Debugging Tools (from the Windows SDK) to get some memory ...
0
votes
1answer
36 views

centralized powershell backup script

We're needing a powershell script to backup a folder from 3 remote servers: server1 server2 server3 same source path on each remote server: c:\backupfiles To a central local folder with today's date ...
0
votes
0answers
40 views

Powershell Import-Module doesn't work when in script

I need to import the ActiveDirectory module for one of my scripts. When I do this from the command line, running Import-Module -Name ActiveDirectory ./script.ps1 Everything works just dandy. But ...
2
votes
2answers
35 views

How to control which version of Powershell Puppet shells out to on Windows?

Microsoft recently changed their download repository for Windows Powershell to require TLS 1.2+ which Windows Powershell 5.1 doesn't support without the runtime setting change to Net....
0
votes
0answers
36 views

Powershell / Command prompt cannot switch to mapped drive when running as another use

in my powershell prompt, logged into a Windows 10 PC as Domain\UserA i can run the net use command to see my shared drives net use lists +--------+-------+----------------+---------------------------+ ...
1
vote
1answer
131 views

Powershell: install RDS Terminal Server Gateway SSL Certificate

I have a very simple Powershell script to renew SSL certificates. We are using short duration SSL and this is a repetitive process. On our TSG (Terminal Server Gateway), I automated the IIS ...
1
vote
2answers
77 views

Zabbix low-level discovery - CPU usage per process - two items with identical keys

I'm trying to use Zabbix for monitoring CPU usage by different processes on Windows Server. Processes to monitor are not determined upfront. I want to use LLD to monitor top 3 CPU demanding processes. ...
-1
votes
0answers
21 views

How can i get report from user that has completed a full scan using MS Defender

I'm new to powershell scripting and in the field of MS Defender. I have a request to collate result from user machines that has completed a full scan and info required are Get-MPComputerStatus, I have ...
0
votes
0answers
33 views

Trying to create a Powershell script to connect to a server via smart card

Sorry if this is in the wrong community but it seemed the best. My organization is trying to automate the commands that it has done manually before (Indexing computer storage, etc.). However, we use ...
0
votes
1answer
129 views

How can I secure erase a drive using Powershell?

Does Powershell have a built-in way to secure erase a disk? By secure erase, I mean writing random data or all zeros to the entire disk. By disk, I mean the whole physical disk, not individual files, ...
0
votes
2answers
58 views

Unable to extract full user list from AD OUs having 2000+ user accounts. Limited to 2000 users

I want to extract all users in Active Directory, using the following command. Few OUs have more than 2000 user accounts. Here using this command, I do get the users as desired but the users in the OUs ...
2
votes
0answers
26 views

Error exporting VM configuration

I'm attempting a config-only VM export using this script, which was originally posted nearly ten years ago. Hyper-V internals have clearly changed since then, as I'm getting an error message: Failed ...
1
vote
1answer
63 views

Powershell - Invoke-command does not run the msiexec.exe

I want to install the TortoiseSVN-client on a bunch of servers, using Powershell remoting. Basic operations work, but the below command won't work as remoting Invoke-Command -ComputerName myserver -...
0
votes
0answers
20 views

SCCM Add Collection into a Collection Powershell

i'm starting with powershell in SCCM, I connect into a site, and with $tete = Get-CMCollection -Name "XXXXXXXXXX" i can get: $tete.CollectionRules this last contains a lot of object like ...
1
vote
1answer
43 views

How can I kill a process remotely on a windows server when the server has exceeded its memory limit?

Context I use and manage* a windows server at work. It is used for general computations by up to 5 users at a time via RDP. The server has 128GB of RAM which is sufficient for the work we do on it. ...
0
votes
0answers
38 views

Converting an Excel/Exchange Online Powershell script into Azure Logic App / Azure Functions

I have a Powershell script that I'd like to convert to an Azure Logic App (or some other method of Azure automation) but I'm unsure of the best combination of Azure tools to use to achieve my goal. My ...
0
votes
0answers
26 views

parallel instances of Robocopy not getting CPU time

I'm trying to copy large directories from 3 sites. I noticed that robocopy was using < 25% of my CPU, I figured I can spawn 2 more instances in parallel to copy the other 2 sites. However, I am ...
0
votes
0answers
20 views

Office365 Create new spam bypass transport rule via powershell

I need to create a bypass rule for all of Proofpoint's IP's. When I attempt to follow PowerShell command to bypass Office 365 spam filter , it doesn't seem in inject anything into the rule. Or, it's ...
0
votes
0answers
19 views

Getting Current / Active session in Azure virtual machine using powershell(Runbook)

I'm trying to get the current active session in Azure VM through the Runbook PowerShell. If there is no any active session / usage then planning to stop the VM. The problem is, I couldn't able to get ...
2
votes
1answer
44 views

Preserving AD Configuration (User/Groups/OUs) After Uninstalling “Active Directory Domain Services” Role

I have somewhat of a unique challenge, I'm trying to migrate a old legacy server from a locally installed version of Active Directory Domain Service to a centrally managed AWS Directory Service. As ...
0
votes
1answer
26 views

How do you build an MSIX package from the command line

My end goal is to be able to run a Powershell install script in a VM and capture all the changes it makes into a MSIX package. I can do this manually without issue using the MSIX Packaging Tool wizard,...
1
vote
1answer
70 views

Can't query certain namespaces/classes in WMI (Get-WmiObject: Not supported)

I'm trying to query classes in the root\microsoft\windows\managementtools namespace, but am getting an odd error. I have confirmed this namespace exists on my machine, because I can query it using ...
0
votes
0answers
24 views

Copy a folder from one location to another location based on the Folder Name

I'm trying to copy a folder from one location to another location based on the Folder Name. I need to move the folder for each user (the username is on the folder name) to another location. For ...
0
votes
0answers
16 views

Settings to upload large file via WinRM and Copy-Item - Powershell

I´m trying to copy a large file (around 180MB) to a remote server using PowerShell Copy-Item. Copy-Item –Path "$sourcePath" –Destination "$destPath" -Force –ToSession $session It works for files of ...
0
votes
0answers
104 views

How to properly add .NET Core 3.1 assemblies to PowerShell session?

Related to this question: How to properly add .NET assemblies to Powershell session? I used this code to likewise try to load a .NET Core 3.1 assembly into a PowerShell session. I used this code: ...
0
votes
1answer
92 views

Powershell script to find AD user with firstname and lastname

I wrote a script to find users in AD using their firstname and lastname from a csv file. When i execute the script, I dont get any output. Also no error.... Please help if any issues with the script. ...
6
votes
1answer
77 views

Hyper-V Server VM stuck at boot and I cannot delete it

I am using Microsoft Hyper-V server with Admin center. Admin center says: VM Status: Paused-Critical Powershell says: VM status : In service. After server restart one of the virtual machines is stuck ...

1
2 3 4 5
73