Custom Scripts.
Team,I would like to get a PS script to send emails to the user's personal email.Please note the users will have mailbox on-prem but I want the user credentials to be sent to their personal email...
View ArticleLimiting session time
I have a Windows Server 2012 R2 on which a policy needs to be set. This policy should logoff a user if it is disconnected or idle for more than 2 hrs. One twist is, I have a user with name 'Invo'...
View ArticlePowershell script to extract specific VM info from Hyper-V SCVMM
Hi Folks,Looking for some guidance here, here is my script: $Data = @() $VMs = "SOMEVM" foreach($VM in $VMs) { $VMInfo = Get-VM -Name $VM $VMNetwork = $VMInfo | Get-VMNetworkAdapter $VMVHD =...
View ArticleGet-ADComputer variables in SearchBase and Filter
Hi guys,Please help with the following question.I have the code in my script and it is working.$servers = (Get-ADComputer -SearchBase "OU=CRMBilling,OU=Servers,OU=KYIV,DC=corp,DC=ukrtelecom,DC=loc"...
View ArticleDouble quotes in cmd
Hi All,Hopefully this is a very straightforward question, and apologies for asking if so but despite a lot of googling I can't quite get to the bottom of it :(With the below code I'm simply trying to...
View ArticleRegistering a scheduled job via Powershell Remoting does not work if using...
Hey helpful people!I have an issue and I don't understand it:I want to register a scheduled job on a remote machine, using Credentials of a Local User on the remote Machine.$PSsession = New-PSSession...
View ArticleWMI Query to retrieve only active IPv4 address
My turn to ask a question. I am running BGInfo for all workstations but at this stage want to only return the Active IPv4 address. I have a custom WMI query set up in BGInfo:SELECT IPAddress FROM...
View Articlecalling a exe file from Powershell
HI ,I am trying to call a exe file using Start-process. When I use credential parameter, I can't use verb parameter and vice-versa.$path = "H:\soft_web\software\notepad++" $username = "MUMBAI\asharma"...
View ArticleReopen last used tabs in Powershell ISE
Hi Scripting GuysI use a lot of tabs in Powershell ISE console in my work, as an Administrator, and every time I close the ISE I need to reopen every tabs that I used before. So my question is:When I...
View ArticleScan Subnet Range and check Bitlocker status
I know I can do this:$computers = 'PC001','Laptop002' ForEach ($computer in $computers) { #$client = $Computer.Name if (Test-Connection -Computername $computer -BufferSize 16 -Count 1 -Quiet) {...
View ArticlePrinting using InvokeVerbEx("Print")
Hi all,I'm using InvokeVerbEx("Print") to print files. After banging my face on my keyboard for a full half an hour my script now works like a charm, printing all the files with specific extensions in...
View ArticleGet Computer Names based on Active Directory Username
Hello!I am fairly new to power shell. I am looking create a script that looks at a list of Active Directory user names from a csv file and then gets the computer names for each user. I would like it...
View Articlewindows server issue
i need script or one way to set the minimum or maximum size on Recycle Bin in windows server 2016?how can i set a maximum time to keap data for recycle bin ?and how can use the comman to show the...
View ArticleHow to Search All Fields in Active Directory for a String with Powershell
I can search for string in a specific field in AD like so: get-aduser -filter * -Properties * | Where-Object {$_.Company -match "string"} But how can I search all fields for all users for a specific...
View Articlenotification icon using powershell
Ive got this code which works fine....[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon$objNotifyIcon.Icon =...
View ArticleHow to pass 2 variables to a function in Powershell
Hi All, I am trying to pass the two variables to a function in Powershell. The variables are being generated from two button clicks and they are called $ChosenItem1 and $ChosenItem2. It seems that I...
View ArticlePOWER SHELL ERROR
WE ARE PLANNING TO USE migration by below script but unable to achieve it , can u please let me know where is the issue with the script SCRIPT ; function Start-DbaMigration {...
View ArticleHow to analyze the PowerShell console output with tools such as Excel and...
In order to find out why system drive used up so fast, I modified the script described in https://blogs.technet.microsoft.com/heyscriptingguy/2012/05/25/getting-directory-sizes-in-powershell/ to...
View ArticleReading Lines from a Text File with a Command Line Batch File
Hi,I have a text file that has four lines of text as follows:HelloPlanetWelcomeGoodbyeI have a batch file that I would like to read in each line and set each line to a variable. For example my batch...
View Article