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

PowerShell via Task Scheduler

I have a PowerShell script that is scheduled to trigger every 30 minutes. I have noticed that sometimes it works and sometimes it does not work. When it does not work I see two event message one in the...

View Article


Multiple perfmon counters or multiple cmdlets at the same time

is it possible to run multiple cmdlets at the same time or is it possible to use get-counter to get results from multiple counters at the same timeFor example :Get-counter -Counter...

View Article


Compare dates

HiI'm trying to ascertain how long ago (hours/days) a change was made to specific attributes in Active Directory. I'm doing this by comparing the date on the individual attribute metadata with the...

View Article

Code Doesn't Work With PowerShell 5 Furthermore

Hello community,I am using SAP GUI Scripting with PowerShell. Last week I update to PowerShell 5.0.10586.117. But now the code, which runs with PowerShell 4 trouble-free, throws an error. I checked the...

View Article

Auto Run PowerShell script from WinPE

I'm in the process of creating a PS script that backs up files from locations I've specified.  It currently works while in Windows, but I am now trying to get it to work upon booting from a WinPE USB...

View Article


Changing width of [System.Windows.Forms.MessageBox]

Hi, i have a script that displays output to a [System.Windows.Forms.MessageBox]. The problem i have is that the messagebox is not wide enough to display the information.  Is there a way of modifying...

View Article

Does anyone know when to you use '+' or '.' when accessing enum values (or...

Example:To get the documents and settings folder from powershell, you do something like:[System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::MyDocuments)SpecialFolder is a .NET...

View Article

Scheduled PowerShell script cannot call external program on Windows Server...

Hi guys, we've recently migrated our solution/scripts from Windows Server 2008 R2 (64-bit) to Windows Server 2012 R2 (64-bit). One of the PowerShell scripts, scheduled to run in TaskScheduler, doesn't...

View Article


My First PowerShell Function

I am attempting to write my first powershell function. Here is the sample and it is not executing as expected. My problem is when you run it and it returns a positive result is should run the second...

View Article


Difference between Remove-Item in Powershell 3.0 and 4.0

Hi! Just a simple questionSeems that there is a difference between PS version 3 and 4 running this command, because in PS 3 it leaves the content in the GetFoldersizePortable (which is a folder) and in...

View Article

Remote-Shutdown fails on Windows 10

Hi!I have a number of computers running Windows 8.1 and Windows 10 that I need to reboot remotely. All the computers are used for development purposes and no one is connected to an AD. I use the...

View Article

ForEach loops to coordinate data from two different arrays?

Greetings all!I have a PowerShell problem for which the answer does not readily present itself. I have two Domains, Prod and Test.  I am running a PowerShell script from a Prod utility server.  I want...

View Article

Set Multi-value Lookup Field Value using Powershell

Hi;I try to update a Lookup Field Value using Powershell but whitout success ? Any error but any change on the field value (Market).My script is :function UpdateField {...

View Article


copy objectguid value to extensionattribute

Hi all,in a very complex AD/O365 consolidation project i need to copy the objectguid value for each user to extensionattribute15However i convert the value to bytearray or base64, the copied value in...

View Article

How to browse the powershell namespaces?

How do I expose/browse types/methods/classes exposed in powershell modules and utility libraries.  ILSpy?For instance:How do I find System.Math without having to need it first and then googling it...

View Article


Powershell remove machine from domain

Hi allI have been working on a script to remove machines from the domain. I am running into a couple of different issues.1. The machine is not in ad and the local machine thinks it still it. It will...

View Article

Image may be NSFW.
Clik here to view.

Power Shell Set Printing Defaults

I need a powershell script to set the paper type in the Printing Defaults section of a printer driver, I have a number of devices that have gotten changed from unspecified to prepunched or preprinted,...

View Article


Get-Aduser Error Handling

Hi Guys,I have a text file which contains email address. Now some of them are not valid users for my domain. When I am using Get-ADUser -Filter {EmailAddress -eq "Emailaddress"} |select SamAccountName,...

View Article

Office365 - Search specific mailbox - download attachments where type=zip &...

hihow can I achieve searching a specific users mailbox and download any attachments with attachment:zip and from:some@domain.local..I've been looking at this:Get-Mailbox -Identity source@domain.local |...

View Article

NEW-PSDRIVE - Active Directory Persistence

Hi I'm trying to set up new PSDrives on my local machine so that I can administer remote domains without having to log on to the various serves in those domains.I have used the following command to...

View Article
Browsing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>