Powershell - create new WMI namespace
Hey ,I have found the following script in VBS to create new WMI namespace...
View ArticleHow to catch a PowerShell remoting exception
Hi,I need to run a PowerShell script on a number of computers. Doing some sampling, I discovered that remoting is not necessarily running on all of the computers and causes the script to fail. Remoting...
View ArticleNew-NetNat : A parameter cannot be found that matches parameter name...
When I'm trying to create a NAT, I got the following error. New-NetNat : A parameter cannot be found that matches parameter name 'InternalIPInterfaceAddressPrefix'. At line:1 char:28Does anybody know...
View ArticleScript Export To CSV
Hello Guys I am Executing the Script below, to get Logon History, but i dont know how to export into CSV the Results, guys help with the correct parameter to do that, another question is, how can add...
View Articletest path for remote registry in power shell
I am trying to use test path to see if a registry key exist and if so display that key Get-ItemProperty "hklm:\SOFTWARE\Updates\Microsoft Update - Slow Login Fix" The above command works fine on mine...
View ArticleOneDrive on Demand Exclusion
Hi all,The PS-Script below works fine to set some directories and its data to offline. Would like to extend with the $Exlude Variable to exlude some type of files. Can somebody help?Thanks.$Exclude =...
View ArticlePowershell - Invoke-webrequest - error while sending the request
Hello All,I'm using Invoke-webrequest code similar to below and this works fine across most sites.Invoke-WebRequest -Uri "https://www.bbc.com/" |select -ExpandProperty Content | Out-File...
View ArticleSource files not deleted after the move
Hi Experts,I am trying to move log files from source to destination. I tried both Robocopy and move-Item (powershell). However, I am having issues with both. Could you please advise. Thank you.Issues...
View Articlenetsh command without run as administrator
Hi,Is it possible to run netsh command without the build-in administrator or runas administrator?Have to run netsh command with an account which has local admin privileges(user is in local...
View ArticlePowershell: get-content of ps1 but remove the comment block
Hi,I'd need to read the content of of ps1 file WITHOUT the comment blocks (everything between <# #> or everything which has # in front of it. Can you advise howto addres this? Thanks!F.e.ps1<#...
View Articletracking users log on/off in last day vbscript
Hi,I would like to make a VBScript which realizes the next thing:looks at users who have logged in on a server in the past day (or at a specified time) and lists them (echo,txt etc...).and then adds...
View ArticlePowerShell DSC File Resource Failing on "A general error occurred that is not...
Please help, I see no reason why this is failing, the configuration prior to the FileResource works OK accessing the fileshare and installing, so it is not to do with permissions, does anyone have any...
View ArticleTools to create simple PS classes
We have several tools to create POJO using json schema. Is there a way for powershell developers to create PS classes using json schemas defined?
View ArticleCopy and Install windows updates through Batch File
Hi Experts,My requirement is to copy multiple windows patches from a network location(where offline downloaded patches already placed) to the client machine and install them one by one with single...
View Articlegetting error while calling a api post method
Hi All,I am calling an API for doing some stuff. I am getting error invoke-restmethod : The remote server returned an error: (400) Bad Request.{ "timestamp":1596728550480,"status":400,"error":"Bad...
View Articleunable to enable winrm over https
I am trying to enable winrm over https but keep getting error Connecting to remote server xxx failed with the following error message : The client cannot connect to the destination specified in the...
View ArticlePowershell find users last logon time with multiple properties
HiI found the below script which works well but I would like to modify it so that instead of getting all users it only extracts user accounts that have specific words in the description field of there...
View ArticleList the Manager of Users in AD - Using Powershell - Get-ADuser Syntax issue
Hello Everyone, Need one help, as i stuck in powershell Get-ADuser sytax error. The ForEach loop is giving the real issue while retriving the details from the source file (List.csv).Import-Module...
View ArticlePowershell -replace challenge
Hello Scripting Guys world...My first post here...I need to remove hyphen in specific case (only if surrounded by other characters). Content of MyFile.txt Jean-Francois1 - Title - Year - Country -...
View ArticleChanging Directory within Powershell
Within Powershell, I want to change directory from PS C:\WINDOWS\system32 to PS C:\Program Files\WindowsPowerShell\Scripts, What would be specific command for this?I've been using the Set-Location...
View Article