This script will Grant usb exception by asking the admin to place the machine...
$machine= Read-Host "what machine would you like to give usb exception too" Enter-PSSession -ComputerName $machinecd hklm: Set-ItemProperty -Path...
View ArticleUnexpected output from function when used in a Foreach construct
Hello Mods, and Members,I'm new to PS scripting (not to programming or CS) and could use some assistance in debugging a simple function and use of that function. I've been through the powershell 3.0...
View ArticlePractical PowerShell Part 4: Output Formatting
I hope the journey is more valuable than the destination. When we left last time, I had a script that wrote a custom object to the pipeline. This is the relevant section of code. Read More
View ArticleAll drives
Hi,Is there a way to search across all drives on the computer? E.G: C:\; D:\; E:\ etc..Starting from this short line, where I am searching "Powershell" folder on C:\ drive, but this is far far away my...
View ArticleGet the process owner via PowerShell
et’s say you’ve got an app that needs to be closed throughout your environment. If you can identify that app by a running process, you’ll probably want to know who has the application/process still...
View ArticleSet Up Multiple Azure VM Servers with PowerShell
ou also don't want to put your data and log files on the operating system disk, so you need to add disk drives to properly place your data, and you need to enable TCP ports so you can communicate with...
View ArticleGet Service accounts list from remote server.
Hello Team,I wrote a code to get the service accounts list from remote server where i skipped Slandered Service accounts .What i am looking is ...I want a services which are running with Service...
View Articlei want to be able to close out all process that use less than 10 of the cpu...
So far i have the below after chrome list is created i want the machine to just delete all the chrome pages that are on the list. enter-pssession -name Get-Process | Where-Object {$_.cpu -lt 10}...
View ArticleUsing Get-QADUser to query a list of users and export the results to a CSV File
Hello and thanks for your patience. This should be an easy one - and as you have said you before you won't learn powershell until you force yourself to write a script you need in PS instead of going...
View Articleforeach loop
This is due to my comprehension issues, but I'm trying to find a way to import a list of names from a text file, and get their primarysmtpaddress and alias. Of course, when I run:Get-Content...
View ArticleChanges to AD objects (users, specifically)
I have a script that creates a list based on a custom object, as this saves time because some of the attributes are calculated based on existing AD attibutes. If I save the results to a .csv or .xml, I...
View ArticleCreating a Menu
Hello,I am in school and am looking for some help. This is my assignment:Unit 2 Lab Assignment 2For this assignment, you will create a script that meets the following requirements:Includes appropriate...
View ArticleAudit/Validation Script. Help needed.
OK so I am just finalizing an automated Citrix Server build process in work but need some help with a script/scripts. The old build process ran a script at the end of the build, to check server...
View ArticleSimple cURL in PowerShell 2.0
Among other things, Powershell 2.0 doesn't have the useful cmdlet Invoke-RestMethod. I have application with PS v2 module inside so can't upgrade to version 3 and most examples I've found use version...
View ArticleCode enchancment
Hi All,I need assistance in enchancement below code and make it into function. here is script belowIPch = test-connection command is used and it will capture the ping status$ip = ip address depending...
View ArticleFailover Check Script
I'm looking to create a script that will loop through each entry of Get-MailboxDatabase and checks the ServerName that they are active on. If the ServerName is equal to "test2" it means the server has...
View ArticleHow do I arrange mutilple foreach loops into a single loop for each item?
I have written this script to find out who has access to an Exchange Distribution list. They are locked down so staff can’t spam the whole business with their latest request to sponsor them for...
View ArticleStatus DAG database locations
This is a script I wrote to show the status of all Exchange 2010 DAG databases. It displays to the EMS console color coded to see db's running off of Activation Preference location. And it will handle...
View ArticleIs there a way to check if a variable that you have matches something inside...
Hi All,I have a general question about powershell. I basically am looking to see of I had variable equal to something, is there a way that I could search an array and see if a value within an array has...
View Articlehow to copy an in-use file?
We are using Office 2010 which has some bugs when it comes to storing your Outlook .PST files on the network. So I'm working on a way to copy their .PST to a network share. If Outlook is closed or if...
View Article