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
17 views

Disabling OneDrive on Scheduled PowerShell Script

I need to disable OneDrive via a scheduled task in a PowerShell script. The command works when executed directly in PowerShell but not when executed via scheduling. The scheduling was done with the ...
Max Bündchen's user avatar
0 votes
1 answer
42 views

Creating a computer account in AD using PowerShell

I want to create a new computer object in an AD domain. Below is the script I am using. Can someone tell where should create credential object for SRV1? In domain controller or in computer? If ...
munishhh's user avatar
0 votes
1 answer
28 views

Enter-PSSession works but Invoke-Command does not to install software

I have this really weird problem. If I use Powershell to remote to another server with Enter-PsSession and run this command, the software installs: msiexec /i "c:\install\AWS\EC2LaunchV2\...
Roman's user avatar
  • 425
-2 votes
0 answers
18 views

Azure Stack HCI - How to move/migrate VM from one cluster to another cluster using PowerShell?

How do I move or migrate a VM using PowerShell from a node in cluster01 to a node in cluster02? Thank you. screenshot1 screenshot2 screenshot3
Nash A's user avatar
  • 1
0 votes
2 answers
54 views

How to remotely add reservation to DHCP Server using PowerShell?

Administrators have restricted RDP access to our DHCP server. I need to add an IP address reservation for a MAC address. How do I remotely add an IP address reservation on the DHCP server using ...
Venky's user avatar
  • 31
-1 votes
1 answer
93 views

How to securely access a machine using PowerShell remoting over the Internet?

I have an Azure VM where PowerShell remoting is enabled and WinRM has the HTTPS listener configured to use a self-signed certificate. I can launch some commands on the VM from another machine on the ...
Palec's user avatar
  • 129
0 votes
0 answers
12 views

BitLocker add Numerical password [duplicate]

I want have on PC add Numerical Password. What should I do. Because how much I searching for information can't find any specific. Any advice? Because in other device Volume C: [Windows ] [OS Volume] ...
Darbas Darbas's user avatar
1 vote
1 answer
50 views

How to implement virtual UNC mapping in a Windows user session?

I need to implement virtual SMB UNC mapping in a Windows user session. Similar to what "NET USE H: \\realhost\share" command does, but redirect "\\virtualhost\share" to "\\...
tchoha's user avatar
  • 11
0 votes
2 answers
208 views

Test-ComputerSecureChannel - Logon failure: unknown user name or bad password

I restored a Win7 image that I know will be out of date. I then run as administrator powershell from an account that is a member of the local machine administrator group. All I get is: Test-...
user3161924's user avatar
0 votes
1 answer
28 views

Need to add errored system to results in powershell

I am writing a poweshell script to find all local accounts for systems in our domain. It works fine except when a system is not available. Then I get the following error: Get-WmiObject : The RPC ...
tjohnson333's user avatar
0 votes
1 answer
54 views

Ubuntu/Orange Pi5 retrieve open tabs on Chromium (kiosk mode) via terminal - Powershell

I have a problem as of late where I am developing some PowerShell script to manage and update some digital displays. Please see below for my work in progress (By no means done). I am struggling to be ...
M.Atkinson's user avatar
0 votes
0 answers
62 views

Retrieve Component Service COM+ Application configuration values

I have a Component Service Application which values need to be retrieved by a powershell script, I've managed to get some configurations like the Pooling & Recycling values with the following ...
Eduardo Medina's user avatar
0 votes
0 answers
53 views

BitLocker Full Disk Encryption - WIN

I am encountering a recurring issue with BitLocker Full Disc Encryption (WIN) via Policy Management on Windows devices. The issue manifests as a failed encryption attempt due to the presence of ...
CPAH's user avatar
  • 1
0 votes
1 answer
154 views

PowerShell ExecutionPolicy prompt while registry value 'bypass'

I need to run scripts without user input. But recently my scripts have started to require input for the ExecutionPolicy. I'd set the ExecutionPolicy previously via Set-ExecutionPolicy for all scopes ...
Thomton's user avatar
  • 15
0 votes
1 answer
33 views

MS SQL Server Analysis Server Powershell administrator entitlement

I am trying to programmatically add an administrator to the MS SQL Server Analysis Server Server Administrators via PowerShell. I can't seem to find a cmdlet or a reasonable method to do this after ...
rismoney's user avatar
  • 113
0 votes
2 answers
282 views

How to export Microsoft 365 group owners from local PowerShell script

My company uses Microsoft 365. When I go to admin.microsoft.com, I can see "Teams & groups > Active teams & groups" as navigation item. Opening one of the groups in the side panel,...
LWChris's user avatar
  • 111
0 votes
1 answer
102 views

check if Windows Firewall is allowing an Application

tl;dr using Powershell, how do I check if the Windows Firewall is allowing an application? Using Windows 10, I want to programmatically check if an Application is allowed through the Windows Defender ...
JamesThomasMoon's user avatar
-1 votes
2 answers
538 views

Run commands remotely via SSH with a powershell script natively

We want to run commands on our network devices via SSH from within a powershell script. I know that we can do: ssh [email protected] But this is interactive and requires you to accept ...
Mario Jost's user avatar
0 votes
1 answer
53 views

Azure getting metrics "Authentication failed" issue

I'm creating a PowerShell script to get metrics from Azure. I have an app registration with API permission to Insights-UserMetric.Read.All (application type). Also Monitoring Reader role assigned to ...
Denis Mukhamedov's user avatar
1 vote
2 answers
371 views

After installing PowerShell-7.4.1-win-x64.msi, $PSVersionTable still shows 5.1.22621.2506

I have installed PowerShell-7.4.1-win-x64.msi, but $PSVersionTable still shows version 5: PS C:\Users\firerose> $PSVersionTable Name Value ...
Vy Do's user avatar
  • 181
0 votes
1 answer
178 views

How to have a task scheduler script running as network service access a network share securely?

Goal is to have a task scheduler task activate a PowerShell script at a certain time. We have had problems where the server restarts and the script doesn't run because I was not logged in as my domain ...
guildwarstiger2's user avatar
0 votes
0 answers
286 views

Windows Scheduled Task Does Not Work With Service Account

I have an odd problem with a scheduled task. The task is scheduled to run at 0202 every morning under a service account. The task is configured to run whether the user is logged on or not and the &...
BWFC's user avatar
  • 101
0 votes
1 answer
26 views

Active Directory. Anyone else have the Everyone Group across OU structure with deny deletechild uninherited?

I have a domain that has the following and cannot explain why its setup at all. Does anyone else have this and know why its setup? Entire Tree's of OUs are found to have an ACL for the everyone group ...
Donny Diamond's user avatar
0 votes
0 answers
84 views

Exchange Migration Batch In-Progress

I am working on migrating users from exchange 2013 to exchange 2019 and ran into an issue when the disk was not large enough for the migration, causing the job to error out and one user to stop ...
bShaver's user avatar
  • 43
1 vote
1 answer
349 views

Managing Orphaned .avhdx Files in Hyper-V with PowerShell

I'm managing a Hyper-V environment and looking to clean up my hard drive to free up space. Specifically, I want to delete orphaned .avhdx files and possibly move some to external storage. I prefer ...
Foad's user avatar
  • 121
1 vote
0 answers
68 views

Powershell Duplicate Headers Error

Hi I have a PS script that is giving me this error when it gets to a sheet with duplicate headers. Duplicate column headers found on row '1' in columns '12 53'. Column headers must be unique, if this ...
Clemson5000's user avatar
0 votes
0 answers
179 views

Powershell script to edit and ‘save as’ an excel XLSM file

I have about 20 users offsite that need to fill out an excel log for their work each day. To help them we make available a 'read only' blank template, and I have setup a desktop icon for a powershell ...
Davschm's user avatar
0 votes
0 answers
102 views

Failed to send SMTP email with PowerShell and Postfix SMTP relay

I tried to correct some errors with a PowerShell script with Send-MailMessage() that sends an email via a Postfix SMTP relay, but it returns this error: error PowerShell I found that I should add this ...
ZeRedDiamond's user avatar
1 vote
1 answer
167 views

Get list of VMs NOT enabled for Replication using Powershell?

I want to monitor the Replication status of all VMs on our Hyper-V. All our VMs are replicated. When a replication fails OR the VM is removed from replication, I want to know. I found the following ...
WishIWasACoder's user avatar
0 votes
1 answer
101 views

Running A Script From Parent Domain Server To Child Domain With Child Domain Credentials

I have written a Powershell script which checks the OS and does some security scans. The server we run this script from is a member of the Parent domain of my system. I need to run this script from ...
JukEboX's user avatar
  • 835
0 votes
0 answers
94 views

Open Excel from Powershell, running from Task scheduler

What I'm trying to do: I want a scheduled task to refresh Excel queries (ODBC), save them, and email them to clients. What I got so far: I have a PowerShell script that runs opens an Excel file and ...
Omri Liad's user avatar
0 votes
0 answers
267 views

Can't get a Local User Account to Run as the Identity of an IIS app pool

I am attempting to move a project forward using a local user account as the IIS app pool identity until domain trusts are established. I have tried everything I can think of to have a local user ...
Ross Bush's user avatar
  • 121
1 vote
0 answers
104 views

Why am I only seeing logoff, but no login, events in Windows Event Logs?

I want to audit when every user logged into of logged off a server via RDP. When I run Get-EventLog or Get-WinEvent and filter for Login (Event ID 4624) and Logoff (Event ID 4634) events, I only am ...
Liam Kelly's user avatar
0 votes
0 answers
77 views

AD recursive LDAP query for unexpired temporary group memberships

With Privileged Access Management for ADDS (on-premises), it is possible to temporary add a member to a group, e.g. using powershell Add-ADGroupMember. Additionally, it is possible to use LDAPs ...
rrr's user avatar
  • 101
0 votes
0 answers
185 views

Windows Admin Center RemoteException: The specified module 'CimCmdlets' was not loaded because no valid module file was found in any module directory

I'm setting up Windows Admin Center and have successfully added a few servers. However, I'm encountering an issue when connecting to a server, and the error message I'm receiving is: "...
kevin's user avatar
  • 1
0 votes
1 answer
726 views

SSH public key authentication with Powershell

I'm trying to create a SSH connection between my personal laptop running with Windows 11 and Powershell 7.3.9 and my VPS running on Debian 12 (bookworm). I'm not using Putty on purpose. I first wanted ...
mthgn's user avatar
  • 3
0 votes
0 answers
28 views

AzPowerShell VMs migrated through Arc don't have an OSProfile property

We have a mix of VMs that were created inside Azure, and VMs that were migrated from on-prem to Azure using Arc. In AzPowershell, the information I need (computername) is in the OsProfile property. ...
Michael Cornn's user avatar
-1 votes
1 answer
54 views

Can already opened event log screens of powershell on windows event viewer can be hacked offline by hackers? [closed]

Can Windows powershell give me fake or altered outputs if I use common commands primarily used in powershell checking hash codes is option but they can be altered too theorically so its not that ...
Mande de su ka 's user avatar
0 votes
0 answers
170 views

Windows - access RDP file with encrypted password via multiple windows machines

I have an azure virtual machine which needs to be shared among the users to access a desktop software app. Our PW wants this RDP to be accessible without user explicitly entering credentials. I ...
deathrace's user avatar
  • 101
0 votes
1 answer
243 views

powershell detect login is sftp

tl;dr in powershell, how can I detect a login is specifically SFTP and not SSH or local? On Windows 10 I have the built-in OpenSSH service running. For SFTP protocol connections, the server uses the ...
JamesThomasMoon's user avatar
-1 votes
1 answer
490 views

Error trying to join Azure storage account to domain

I'm running into an error running Powershell (v5.1) cmdlet Join-AzStorageAccount to join an Azure storage account to my domain. I just did this successfully with a storage account, but when I try to ...
phillipank's user avatar
1 vote
0 answers
358 views

PowerShell - Failure to load built-in modules due to software restrictions

Yesterday, I was working with PowerShellEditorServices to develop a tool. Internally, it uses named pipes to communicate between the client and server. They are both running locally. At some point, ...
Adam Driscoll's user avatar
0 votes
1 answer
2k 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
  • 3
0 votes
0 answers
779 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
222 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
1k 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 ...
Vidarsskjalf's user avatar
0 votes
1 answer
731 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
590 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
  • 27
0 votes
1 answer
132 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
  • 3
0 votes
0 answers
143 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
2 3 4 5
83