Quantcast
Browsing all 21975 articles
Browse latest View live

Powershell Exception when using getDynamicParameters to return multiple...

HI TeamI wrote a cmdlet to accept 2 parameters A and B .  Each has 2 dependent parameters. Defined 2 classes to provide the definition of the dependent parameters.Coded getDynamicParameters() to check...

View Article


Install dotnet 4.5 powershell

the script is take from below link and modified for my lab testing I have commented out few lines.Basically I save the below file as ps1 and I run . Invoke-command -computername abc -filepath...

View Article


Problem when opening a runspace in a web application

Hello, I try to debug this code to run commands on a remote Exchange 2010 server (Windows server 2008 R2, host in a VMWare) from my clientUri uriPs = new Uri("http://" + server + "/powershell");string...

View Article

PSSESSION issues with powershell. Wierd result

Hi I have a problem, the problem is that I am running a PowerShell script: $server = get-ADComputer -Filter 'Name -like "serv*"' | select name $server | ForEach-Object { Enter-PSSession -ComputerName...

View Article

Get TCP connections to IP

Hi, is there a WMI or code that can get me the number of the current TCP connections from 1 server to another one?Thanks

View Article


Log output of a function to file

Hey Guys,I'm sure this question has been answered but I'm having a hard time finding the answer. My problem is that I can't figure out how to write the results of a function to a file. Sorry in advance...

View Article

wmi accelerator

Is there a way to convert this:GWMI -query "Select PartialProductKey,Description from SoftwareLicensingProduct where productkeyid is not null" -Computername $HostNameto an accelerator?I have...

View Article

querying network printers

If I open the Windows Printer and devices I see a list of local and share printers. I have a vbs script that retrieves such printers that are display on the interface. if I ran Get-WMIObject...

View Article


Where do I submit a typo I found in powershell v3 help?

Title says it all. I did a quick google search, but didn't really find what I'm looking for. Is there a place to submit bugs/typoes? It's just one missing character in an example.

View Article


Script produces different result when run as a scheduled task than run from ISE

I am trying to schedule a simple script that will test whether a user is logged on or  not, and send an email if not.  $user = get-wmiobject win32_computersystem -computer computername | Select-Object...

View Article

Gracefully close multiple IE tabs

I am trying have Powershell close multiple IE tabs. The command Get-Processiexplore|ForEach-object {$_.CloseMainWindow() } Works fine but it give s a popup which asks if you want to close all Tabs. YOu...

View Article

Invoke-Command Get-Counter

HiI'm trying to run some code on remote computers that use get-counter. But the problem is when the data is returned the CounterSamples is not as expected and the data is...

View Article

How to change input keyboard language in powershell

I have text file that contain arabic text when i import the text file to powershell the texts appear as symbols is there away to allow powershell read the arabic input ??

View Article


Only a part of an array is choosed

Hi Guys!I've got  an array only a part of this array is choosed  but i want to choose all the array:The code:function Move-EmptyDir{ [CmdletBinding()] param ( [Parameter(Mandatory =...

View Article

Remove exchange forwarding for some users and loop help

Hi We need to remove the email forwarding settings for some of our users. Some users have their email forwarded to "My email [BLAH]" where "[BLAH]" always appears in the name of the contact that the...

View Article


Problem with a wildcard filtering for a file extension in a directory

Hi forum,I've found a strange behaviour using a filter on PS-Commandline. When I use: dir "*.sql" I'll get the right answer (only *.sql files). When I use: $Path = C:\MyPath dir $Path "*.sql" OR dir...

View Article

HOW I CAN DELETE SUB-FOLDERS IN MULTIPLE FOLDERS..

I WANT TO DELETE A SUB-FOLDERS FROM FOLDERS BUT.... I DONT KNOW HOW CAN I DO THAT. I HAVE THE FOLLOWING CODE$ROOT =cd 'e:\baks\' $SUBFOLDERS = get-childItem  -name $FOLDERS = (get-date).year if (...

View Article


Use Same Excel Object in Start-Job as Main PS1

I have hundreds of Excel files and one main file that has links to each of these files, but in order for the data to be pulled into the main excel file I need to have every file opened within the same...

View Article

How can I optimize this script?

What I don't like about this script:1) It has to be run multiple times to process multiple staff. I'd prefer if I could input multiple employee numbers at once2) It takes so long to search for the...

View Article

Trimming Specific Text from cells

I have around 36000 lines of excel...

View Article
Browsing all 21975 articles
Browse latest View live


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