Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

Script to change Scheduled Task to run monthly

I need to change many scheduled tasks to run monthly.The problem I have is New-ScheduledTaskTrigger does not have a -Monthly switch.I can create new tasks that run monthly using schtasks.exe, but that...

View Article


Remove-Item Requested registry access is not allowed

Help please,I have written a Powershell script that is trying to use Remove-Item to delete some Registry keys. I am running under Admin. if I go into Regedit it will let me delete the keys but if I run...

View Article


Set-ADAccountPassword throws The operation failed because of a bad parameter...

I got following error when change password operation performed through powershell. DN name contains * character. How can i change password for testuser. Is there any alternate way to encode DN name. PS...

View Article

Unable to set ACL on Remote Registry -Kindly HELP

Hi All, Tried to set ACL on remote registry but it doesn't work. Tested the same code on local computer which works fine. Please help objective : Need to assign full permission to "Domain Users" on...

View Article

Image may be NSFW.
Clik here to view.

Get-eventlog not able to list another log files

Hello,Where is the secret? Could someone explain why im not able to gather content of Operational log file?I just see: But Operational Log file still exist in event viewer? Also is no propertie? how it...

View Article


Powershell Script not running correctly in Task Manager

I have a powershell script which runs FSW to monitor a directory into which new files are added.When I run this script from the desktop, using Powershell running as administrator, it works perfectly....

View Article

Access denied when using Powershell Sendkeys in Jenkins

I'm using the Windows PowerShell Plugin in Jenkins and want to open my browser and start inputing keystrokes. When I use the following code in powershell ISE on my computer it works a charm:Add-Type...

View Article

How to append header upto four columns using powershell in csv file

Hi,I am novice at powershell scripting and i want to write a script in which I can append Name, FilePath, Specification, DateTime as column headers and export that csv file.Please anyone can help me...

View Article


Simple script

Hello , I'm wondering why when I try to run loop script it doesn't work . For example when I run get-wmiobject -computername comp1 win32_startupcommand     - it works but when i try something like this...

View Article


Unable to execute PowerShell script in restricted environment

Hi,I have a PowerShell script below that failed to execute despite putting the"Set-ExecutionPolicy RemoteSigned -Scope Process -Force" command on top. How can I run the script without levitation in one...

View Article

Image may be NSFW.
Clik here to view.

Select-String from $a variable, is it possible with powershell?

Hello, Guys !I made simple variable $a to get required event log....

View Article

I can not change SID by name

 I can not change SID by name. please help-me ============================================================D:\SIDlocal.csvOLD;NEW S-1-5-21-2824013475-2539778625-3844828982-1019;teste...

View Article

Trying to understand -expandProperty and objects

Lets say i would like to get-process from Ad-computerget-adcomputer is an object, so in order to return a string needed for get-process i run the following:Get-ADComputer hostname | Select-Object...

View Article


Sharepoint Online add item to list

I am trying to populate fields in a sharepoint list. I am getting back a  couple of errors."Cannot call a method on a null value expression" and "Unable to index into an object of type...

View Article

Image may be NSFW.
Clik here to view.

Get SQL Agent Job EnumHistory via Powershell

Hi guys!!I  am using Powershell through DollarU (Workload automation software) to execute SQL Agent job (all steps) or one specific step at a time.  So far so good, everything is working!!  However,...

View Article


WARNING: Windows Update for 8/23 breaks PowerShell

See PS Team blog post:https://blogs.msdn.microsoft.com/powershell/2016/08/23/powershell-dsc-broken-in-kb3176932/\_(ツ)_/

View Article

Script - Empty folders

Hi,I would like to write a script to find from when  a folder is empty  and/or  also would like to check if there is no files written to that folder from past 30 mins.lastwritetime is not good option...

View Article


create dynamic distribution group based on logon script.

i need to create a distribution group using the custom attributes that will extract all users who belong to a certain logon scrip. currently using this but not working. New-DynamicDistributionGroup...

View Article

Calling one PowerShell Script from Another

Hi,I am trying to write a PowerShell script that will call another PowerShell script when the first one finishes. Can't get it to work.1. First script downloads some folders and files from a network...

View Article

setting msExchHideFromAddressLists and ShowinAddressBook

Hello all,I'm trying to hide Contact objects from the GAL by setting the msExchHideFromAddressLists and ShowinAddressBook attributes, and I'm having a bit of trouble. My code performs a domain search...

View Article
Browsing all 21975 articles
Browse latest View live