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 ArticleHow 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 Articlecreate 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 ArticlePowerShell 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 ArticleProblem 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 ArticleScript 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 ArticlePowershell 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 ArticleAND operator
$a = 1 $b = 2 if ($a=1 and $b=2) { write-host "Test" }AND is not working. Can someone please help me
View ArticleExtract 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 ArticleTest 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 ArticleHow 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 ArticlePowershell 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 Articlehow 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 ArticleExport 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 ArticlePowershell : 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 ArticleRetrieve 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 ArticleAdd 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 ArticleAdd 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 ArticlePowerShell 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 ArticleString 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