Skip to main content

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
-1 votes
0 answers
20 views

Notify users during logon if their account expires in seven days or less

I am trying to achieve the following: When a user logs into a computer, display a notification if their account expires in seven days or less. (Not password expiration). When the user account is ...
sudoroot1's user avatar
1 vote
1 answer
97 views

How can I determine, using Powershell, without MS Graph, the ability of a user to use Self Service Password Reset (SSPR)?

I don't have access to Microsoft Graph in my environment due to permissions afforded me. MSOnline, in addition to being deprecated, only allows pulling 30 days of records. Is there any other way to, ...
user66001's user avatar
  • 222
2 votes
0 answers
46 views

Adding languages base on the computer in RDS environment

I'm assigning keyboard languages to users in an RDS environment based on the host. For example, if a user is assigned to ts "tsA", spanish will be added to the keyboard. Uf assigned to other ...
Zhao Ses's user avatar
0 votes
1 answer
32 views

Reading full user email adress on intune client

I am configuring windows 11 clients as part of a project to migrate our infrastructure to intune. As a part of this im running into trouble with a powershell script, that work on our non intune domain ...
Samuel's user avatar
  • 13
0 votes
1 answer
19 views

unable to get AWS session via AWSPowerShell in Milano Region via STS

I am using some AWSPowerShell script to get reports from my instances. I have old working instances in Tokio region ap-northeast-1, new instances were deployed in Milano region eu-south-1, To get ...
andrew's user avatar
  • 231
0 votes
1 answer
66 views

Get AD groups a user is member of from all domains and subdomains

I am trying to get all the groups a user is a member of in all my domains and subdomains. Here is the setup : Forest 1 domain1.local sub.domain1.local Forest 2 domain2.local The user is located in ...
IngoMarlboro's user avatar
0 votes
1 answer
117 views

Get-WmiObject access is denied, unauthorized access exception

Following a Windows update on Computer B, the following failed. Get-WmiObject -Class Win32_OperatingSystem -ComputerName "ComputerB" With the error: Get-WmiObject : Access is denied. (...
user270488's user avatar
0 votes
0 answers
41 views

What privileges are required to call Register-ScheduledTask

As the title of the question implies, I need to know exactly what privileges, such as local administrative access, are required to Register-ScheduledTask in Powershell 7.x.
David W's user avatar
  • 181
2 votes
1 answer
41 views

Powershell not initializing

I am using an app System Scheduler to orchestrate jobs on Windows 10 VMWare virtual machine. I came back from vacation and a business user said, "Hey, I haven't gotten any notifications that the ...
Steve Scott's user avatar
0 votes
0 answers
33 views

Persist iSCSI RAM drive across reboots

To create a RAM disk on Windows Server, I used a tutorial at https://i12bretro.github.io/tutorials/0524.html and created a scheduled task with a powershell script, as suggested in its 2nd half. ...
SuperAl's user avatar
  • 123
0 votes
0 answers
32 views

Get time taken for each process during startup

I'm able to list processes that are loaded during boot time using Get-EventLog. But I'm trying to get time taken to load for each process. $bootTime = (Get-CimInstance win32_Operatingsystem)....
r18ul's user avatar
  • 101
0 votes
0 answers
47 views

Windows Server 2019 Core unable to run gpupdate

I have Windows Server 2019 on four physical servers joined to a domain. I discovered that I could not run gpresult. Specifically, I run: gpresult /scope computer /h c:\temp\gpresult.html Which ...
user3271408's user avatar
0 votes
1 answer
95 views

Set-ExternalInOutlook - Keeps reverting to False

Hello- We have an odd issue: We are attempting to configure the in-line "External" tag using the supplied functionality in 365 via powershell: (Set-externalinoutlook) We've done this one ...
Doom's user avatar
  • 23
0 votes
0 answers
138 views

PowerShell Get-WinEvent use FilterXml to select events with specific strings in the message property

I am trying to use powershell to look through event logs that have specific IP addresses in the message property. More specifically, I set auditpol to log Windows Firewall events to the Windows ...
user3271408's user avatar
0 votes
1 answer
216 views

Permissions error in directories used by Docker and application I am developing

I have run a docker container mysql from my own application development on C#, and configured data persistence to this path: C:\ProgramData\Persistence\data\mysql When i start everything goes well ...
Francisco Nuñez IA Lover's user avatar
4 votes
1 answer
279 views

How to create an Authenticode Signing infrastructure?

I am attempting to create the necessary infrastructure to allow authorised users to sign PowerShell scripts and have them be trusted by the organisation, this allows deploying scripts to computers ...
Hugo's user avatar
  • 143
-1 votes
2 answers
116 views

echo. is not recognised as the name of a cmdlet

I am observing an odd behaviour in PowerShell. I can echo hi but I can't echo. to get a newline: It does work in Command Prompt: One answer suggests that the .ps1 file might have a BOM in it. I ...
Danny Beckett's user avatar
0 votes
0 answers
147 views

The Object name has bad syntax when trying to bulk add AD users using Powershell

I'm attempting to add a series of User to AD by importing a csv file and I can't seem to get it to run successfully, the error always reads 'the object name has bad syntax' however no matter what kind ...
RussianLinuxGuy's user avatar
0 votes
0 answers
59 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
158 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
86 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
0 votes
2 answers
125 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
118 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
37 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
56 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
740 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
35 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
60 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
68 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
75 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
229 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
49 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
488 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
246 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
2k 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
73 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
583 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
374 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
637 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
31 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
127 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
891 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
83 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
318 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
147 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
278 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
153 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
124 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
380 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
232 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

1
2 3 4 5
83