remote start application by powershell
I access to remote computer via ssh and running powershell as AS to execute the following command but I can't see the Notepad++ running on remote computer. Invoke-Item -Path C:\Users\Dex\Desktop\Notepad++.lnk or Start-Process -FilePath …
Set-NTFSOwner doesn't work correctly with service account
I have Powershell script that creates home directory: New-Item -Path \\fileserver\homedir$\acn -ItemType Directory -Force -ErrorAction Stop | Out-Null When I test this with my own account that is Domain Admin, everything works fine. But when I try…
Powershell to pass fixed Varibles (SCOM)
Hi all, Totally new to Powershell and would like some help. i have script to put all Agents behind a SCOM Gateway into Maintenance Mode: Import-Module OperationsManager $Time = ((Get-Date).AddMinutes(10)) $ErrorActionPreference = 'SilentlyContinue' …
how to check a value is that null in powershell script
I want to check the PasswordLastSet value of the user is that empty. PS Z:\> Get-ADUser -Identity test1 -Properties * | select passwordlastset passwordlastset --------------- By if to judgment is that null. this is my script $password =…
SharePoint Online Get-SPOUser IsSiteAdm Error 429
Is there another way to find Site Administrators in SharePoint Online? I have tried the following but on some sites I get an error 429. Get-SPOUser -Site $SiteUrl -Limit All | select…
PS -nonewline not work on my console
Hello from PS very beginner. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/write-host?view=powershell-7 when I try cmdlet "write-host -nonewline" on my PS console as tutorial(windows10 Home, PS 5.1) PS…
Remote Job - UNC or PSDrive not found
I have a scripts installed locally on a group of servers. Lets call them the worker scripts. I want to execute those scripts, remotely, as background jobs, from a management workstation. Lets call this the management script. I have the management…
how to block GET-ADUSER from showing result
Hello. I want to block GET-ADUSER from been able to show result. I was able to block users from opening AD users and computers but it look like the permissions doesn't apply to GET-ADUSERS How can I set that command to not show any results? Thank…
the return from Add-AppxPakcgae doesnt contain the UWP information the computer has
Hi, Team. Do you happen to know the potential root cause below ? phenomenon : the return from Add-AppxPakcgae doesn't contain UWP information the computer has. see below more explicit scenario I'm saying. When we did below command on Elevated Power Shell…
Powershell Azure Function throws EXCEPTION: Connect-AzAccount : An attempt was made to access a socket in a way forbidden by its access permissions
Hi I have Powershell Azure function which is called directly by logic app as one of the steps in the workflow. Authentication was established by using system assigned managed identity approach and all was working. I needed to refactor the way how…
Do until has strange settings
Hello, Sorry for the Dutch language; but could somebody help me with the following screenshot? It happens when I click on the settings of "do until": No idea how I can get back the screen of the limits etc... Thank you in…
Powershell- Excel refresh credential window
Hello. I've seen a few questions about this placed since 2016, but no answers. I'm updating an excel spreadsheet with the .refresh command through a powershell script. This pulls up the modal window in Excel prompting for credentials. The credentials…
Get DirectoryName for folder
I have this script which exports a list of files and folders to a csv. Get-ChildItem -path D:\VmWare -Recurse | Select-Object DirectoryName, Name, Extension, Length | Export-Csv -Path D:\Temp\Test.csv -Encoding Unicode -NoTypeInformation I…
List User OU in csv
Good afternoon, I have to export the list of users contained in an OU to a csv file, the code I wrote is the following: Get-ADUser -Filter * -SearchBase "OU = XX, OU = YY, DC = mydomain, DC = local" -Properties DisplayName | Select-Object…
Power sheel Script need to exicute Sql Server data project in Pre Post Build section.
Hi Team, i am trying to connect postgres ODBC driver into SQL server data project to compare the Schema. Power Shell script is: ion Get-ODBC-Data{ param([string]$query=$(throw 'query is required.')) $conn = New-Object…
Catch exitcode from EXE
Hi, I'm trying to catch errorlevel/exitcode from a executable, both return 0. I don't understand why. The folder "d:\Temp\exists\" exists. $rar="c:\Program Files\WinRAR\Rar.exe" $archive1="TMP.rar" $argList =…
Why I cannot find where a property is defined in PowerShell? Where is the source code of the PSObject class?
I want to find the PSObject.cs file in Github, but I cannot find it. And I haven't find any file containing definition of this class (System.Management.Automation.PSObject). In source code of many other classes of PowerShell, I found that the PSObject…
get the security settings from GPO using xml report
I want to export the security settings of a group policy. I have exported the gpo to xml format and then I am using the below: $x.GPO.Computer.ExtenstionData.Extension Where $x contains the xml report. However I getting the result like below: q1 …
How to use powershell to manage startup items of uwp app in windwos 10?
I hope to enable/disable the uwp app's startup items through powershell, but I tried to use gcim win32_startupcommand and Get-Item HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run and they couldn’t be found, shell:startup is…
![](https://techprofile.blob.core.windows.net/images/05jRnbCoIUORBGbm2tcvDA.png?8D8179)
I need to change commas to dot in an excel file using Powershell
I need someone to help me solve this problem. I need to write a powershell script which changes the commas of the excel file to dots. The commas are between the numbers. The table is built up like this: user name user surname …