Powershell learning prerequisites
Hi Everyone,Is it required to be learn .Net to get deep knowledge in powershell because Somebody recommended me to doing this so that I am getting confusion how it could be ?Can anybody please suggest....
View ArticleScript to Monitor free space in UNC Path / Network drive
Hi All,Good Day,I was trying to achieve the below:To monitor a network share and its free space so i managed to write a script as below where it maps the drive as a letter queries the free space added...
View ArticlePhysical memory mail alert when it reaches certain value
Could you please help me in correcting the below.Being completely new to scripting unable to get the output through mail.$Threshold = 20 $output = gwmi -Class win32_operatingsystem | Select-Object...
View ArticleAdjust output format for Ad MemberOf Code :
Hi Experts,Here is a code that fetches me group membership of a user's AD account however when I fetch out data for a list of users output becomes bit tedious and needs lots of manual efforts to sort ,...
View ArticleDL group members update skip not found users in directory
Hi, Below script using for DL - distribution list group updates. Script updates are quite good, however if any user not found in directory, script will skip entire DL to update further its members...
View ArticleHelp sending Get-Eventlog output to an output textbox
I have a powershell app I'm working on. One of my buttons is called GPUPDATE Verify where it calls a function to check the system log on a remote system to make sure GPUPDATE ran on it and send output...
View ArticleAny way to find when a Hyper-V VM was last powered on or how long it's been off?
Hi,We're trying to weed out some old VMs that have been off for an unknown amount of time and want to know what that amount of time is.I found a script here that seems to get some good info:...
View ArticleShare Files on 2 Servers
How do I share files on 2 different servers from server A to server B, also how do I add a user on server A and how do I set up DNS on server A. I need to do all of this in Poweshell
View ArticlePowershell Variable trimming
Geeks,Im trying to trim the below string but unable to get what i acheive-$string = "\\winfile01\D$\share01\2016\May\Dept"I would like the $string to be trimmed and saved as value "Dept" stored in...
View ArticleWrite True or False to a txt file
being new to powershell this might be very easy for everyone hereI have been tasked with creating a script that a monitoring service can runThis script needs to look for a certain word in a certain...
View ArticleFetch email address from display names of Distribution Groups :
Is there a way to get email-address\ Primary-SMTP address of DLs from a List of Distribution List Display-names as input ? Specifically I need the output to be in following format? Kindly suggest...
View ArticleInternet Explorer COM Automation Not Working
I've been searching for a solution to this for a while and I'm stunned and embarrassed I haven't found more helpful pages with information how to solve this problem for myself.I have a few different...
View ArticleCannot find local service?
From time to time, the media keys on my keyboard stop responding. If I restart it, it works just fine. I want to write a one-liner for my desktop that restarts it.However, I keep getting this weird...
View ArticleEnter-PSSession errorcode 0x80090322
HiI've got this ugly error "errorcode 0x80090322" when accessing one specific remote system:Enter-PSSession : Connecting to remote server myserver failed with the following error message : WinRM cannot...
View ArticleHow to extract columns from PowerShell
Hello,I am new to the PowerShell programming. I want to extract AD information by providing an input <g class="gr_ gr_127 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace"...
View ArticleScript error in CLI but not ISE???
I get an error when running a script via the cli, but not Powershell ISE! I do not understand why. ERROR: [06/09/2016 07:57:26] System.Management.Automation.RuntimeException: Method invocation failed...
View ArticleCreate new object using ForEach
HelloIs there a way to re-write this using Foreach loop? $JamesObj = New-Object PSObject -Property @{ Nationality = "Japanese" Age =...
View ArticleReducing Powershell CPU Usage During Start?
I often run Powershell processes on my server and find the CPU usage spiking up because of this unacceptable.Some background info: I have an application (let's call it management app, to avoid...
View ArticlePowerchell - Error looking for sub OU
I have made this script:$startDTM = (Get-Date) $path = Split-Path -parent "C:\a" $logdate = Get-Date -Format ddmmyyyy $userdisableddate = Get-Date $csvfile = $path + "a\User_Info.csv" $logfile = $path...
View ArticleWARNING: HOTSKP036: Cannot index into a null array.
Hello I keep getting the error about null array and as such I won't let me update my SQL.As for the HOTSKP036 is the computer I'm using to remote access the Windows 2012 R2 server it is not in any of...
View Article