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

Sendkeys not working on the system Print window

After bring up the windows system Print window on a webpage by using Powershell script andmanually press Enter key, it will print to xps as default printer. However, it will not print after use...

View Article


How to navigate on a list

Some webpage has unordered list (<ul><li>...</li></ul>). when click to select an item, it will navigate to another page. how can I use Powershell to do it similar as...

View Article


create connect-server type powershell cmdlet

We use a product called papercut to handle printing for students and staff, and i'm wanting to create a powershell module that contains cmdlets that map to functions that are exposed by their Api....

View Article

PowerShell ISE - Value cannot be null with simple command that works in the...

I'm using PowerShell ISE(2.0) to remote to a Exchange 2010 PSSession. When I try to run a simpleGet-Mailbox -Identity 'Username' I get 'Value cannot be null'?

View Article

Problem to execute PowerShell in C#

Hello Everyone, i´m trying execute a Sql Server Full backup in C# using this code:     private string RunScript(string scriptText)        {            Runspace runspace =...

View Article


Script to launch cmd line, get unix utc time for the day, email results of...

Howdy - These forums are great, and I'm hoping to get some help with a headache I have on doing a process manually that should be easier to automate than I've found it to be. I have a command line tool...

View Article

Powershell script to read xml data from multiple remote computers

Hello, I'm trying to put together a script to read data from a very simple xml file on multiple remote computers and output that data into a csv file.The remote computers are listed in a txt file (ex...

View Article

AND operator

$a = 1 $b = 2 if ($a=1 and $b=2) { write-host "Test" }AND is not working. Can someone please help me

View Article


Extract some records from an xml file and save them to another fie

Hello All,I need to extract some records from an xml file based on some criteria and copy them to another file. I am just stuck on how to save the selected records to another file. grateful if you can...

View Article


Test for JSON member presence or absence.

I have code that creates a PSCustomObject via ConvertFrom-Json like:    $jsonResponse = $webStreamReader.ReadToEnd() | ConvertFrom-JsonIn some cases the JSON object will contain a field 'error' and...

View Article

How set "Include inheritable auditing entries from this object's parent" for...

Hi,I'll like to request your help in order to find out a way to set the option "Include inheritable auditing entries from this object's parent" for a folder using powershell, I'm using this way...

View Article

Powershell Find / Replace advice - Script provided

Good AfternoonCurrently i am producing a script to open up a word document in a particular file location, then to get a find and replace taking place in the document as per the find/replace strings,...

View Article

how to get the the last part of a path using windows command line.

ex:my path is \\hello\123\images\Config4567how to get only "config4567" and store it in a variable using windows command line.not using powershell...I want using the windows command prompt./batch file.

View Article


Export only active directory contacts with all attributes.

HiI need to take backup of contacts in AD with all attributes so that during one activity any contact deletes, then can restore it.Also how can restore AD contacts from poowershell..Please guide and...

View Article

Powershell : List Users with same primary group

Hello everybodyAfter reading a lot I finally decided to post :)First : I am not a PS expert, just have some basis allowing me to do what I need (until today :P)I am looking for a way (in powershell) to...

View Article


Retrieve all Inbox Rules from my tenant (Office365)

Hi everybody,Is there any way to get all Inbox Rules from my users in my tenant?For example, I try to run the cmdlet "Get-Mailbox user@domain.com | Get-InboxRule" but it fails with the below error...

View Article

Add Array Items to Listbox

Hello. I'm relatively new to PowerShell and have only been working with it for a few weeks. I am trying to add the items in an array to a listbox. I am working with Active Directory. I would like to...

View Article


Add a domain user to Local Administrator Group using Alternate Credentails.

I wrote the following script to add a domain user to local admin group using alternate credentials. .$comp = "" $user = "Domain\User" $pass = "password"$str_computer = "servername"$comp =  New-Object...

View Article

PowerShell and VisualStudio?

I have tested a script stand-alone both as and not as the Administrator and it works just fine. So I added this script to a build event as part of a VisualStudio project. When it runs there I get the...

View Article

String escape?

In the samples for Add-Type there is the following code:    PS C:\>$source = @"    public class BasicTest    {    public static int Add(int a, int b)    {    return (a + b);    }    public int...

View Article
Browsing all 21975 articles
Browse latest View live


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