Quantcast
Channel: PowerShell General
Browsing all 10624 articles
Browse latest View live

A few big questions

I have been tasked to create a powershell/sql solution for monitoring up to 50 servers for multiple perfmon counters and hitting WMI for metrics.  What would be the most efficient way to create this...

View Article


find only service accounts

I have a 2nd issue with AD.  How would I find only Service Accounts from AD?   I like the Qwest tools so I use Get-QADUser but not sure now to find them.  I know that our service accounts do Not follow...

View Article


Foreach loop through multiple CSV files fails after 3rd file

I have a folder with 7 CSV files and I'm attempting to loop through each and parse two cellsThe cell values consist of computer and process name and I'll use the variables in some other copy functionsI...

View Article

Restart list of servers in a file, capture a log file then email results?

Hello - I have read several posts online about how to do this task and I am not finding one that works really.The ask of me is to restart servers from a list inside a text file and reboot them one at a...

View Article

Monitor folder & Upload files to FTP and download the response file

Hello,This codes are uploading the files to FTP Server, but i need modification to automate it, being a newbie its very difficult for me to get the result, I need help.1. The script to monitor the...

View Article


Query 2 registry entries for a workstations by OU and output to an excel file

I am just learning powershell of course, but I need to find a way to query 2 registry entries in the same key "HKLM\SYSTEM\CurrentcontrolSet\control\Session Manager\Environment" and then output that to...

View Article

windows 2012 & PowerShell commands

I was told in June while waiting in line at TechEd that when you execute a command in windows 2012 it is stored in a PowerShell format somewhere in a directory.  Does anyone know where this folder...

View Article

Powershell moving files but backup the files before replacing

I have three directories: 1. RFC 2. Source 3. BackupRFC contains files and folders(that contain files) that I need to replace in the source folder but before I replace/move files I need to backup the...

View Article


O365 mailbox move

Hi allUsing shell I can move mailboxes to 0365 by running the following cmdlets, I just need to manually add prem and cloud creds when prompted:$LiveCred = Get-Credential (ENTERS CLOUD ADMIN...

View Article


finding machines in AD

I have this code which users on this forum helped me write.   $sourceOU = 'OU=InactiveComputers,DC=Acme,DC=com'Set-QADPSSnapinSettings -DefaultSizeLimit 0$old =...

View Article

Select-String

Hi,I'm trying to search for two values in a text file and only return a list of the files that have those two values, so far I only get everything back, any ideas ? gci E:\test | Select-String...

View Article

Start-Transcript

I always run the PS session using Start-Transcript, but the $transcript variable, which is supposed to indicate the file in use, always returns nothing. Why is this?

View Article

Image may be NSFW.
Clik here to view.

Remote powershell script fails to execute

ExecuteCommand(Directory.GetCurrentDirectory & "\psexec \\myservername -u username-p passsword %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe") Public Sub ExecuteCommand(ByVal Command...

View Article


Resizing a folder full of JPG

Is there a method to resize the pictures in jpg fromat from a folder. using foreach ($_. in $photos) {'' resize/format image etc etc } the resize needs to be specific 400/351 It is a process i am...

View Article

Need help with Invoke-Expression

Hello everyone!I am in need of assistance with Invoke-Expression. In my script I need to build function names to match the domain the script is being ran in.For example, a function is named as...

View Article


Exclude OU not working

I have this code that will get all users from AD $old = (Get-Date).AddDays(-90).ToFileTime()$ldapFilter = '(pwdLastSet<={0})' -f $oldGet-QADUser -LdapFilter $ldapFilter  -SizeLimit 5000 This returns...

View Article

convert Text to objects

My PowerShell skills are very limited and I was hoping to get some help.  I need to convert output text from a legacy CLI tool into objects so that I can better utilize Powershell's capabilities.  The...

View Article


Text in windows forms rich text box not updating properly

Not sure if this is the right place for this question. I have written a windows forms powershell script and I have a function in the script that updates a richtextbox that I have in the form.The...

View Article

Preparing a string that contains both single and double quotes for PowerShell

I'm using PowerShell in a Microsoft Orchestrator 2012 activity.  Manipulating data from Microsoft SCOM 2012 Alert.  When subscribing to the Description string from SCOM alert, the string can contain...

View Article

Get all users with job title "XYZ" and assign license with options "ABC"

Hello AllWe are in the process of a mass migration from on premise to O365, and as part of that I have the lovely task of assigning the licenses. As this is a phased roll out we are currently only...

View Article
Browsing all 10624 articles
Browse latest View live