How to remove all group memberships from list of aliases - using PowerShell
Hello Experts,I want to remove all Distribution group Membership for the list of alias , but no luck . I am using the below code : $allusers = import-csv C:\users.csv Foreach($user in $allusers)...
View Articleget a service from a list of remote computers.
Hi,I run this:$ComputerList = Get-Content -Path "P:\Tools\x64.txt" $ComputerList | foreach { (Get-Service -Name YAM* -computername $_) | Select-Object MachineName, Name, DisplayName, Status}<# Need...
View ArticlePowershell Script help
I have a script that I run daily using a scheduled task that goes through each of my servers and e-mails me the disk space results. However, one of my servers is now using mount points and I want to be...
View ArticleNew-WebServiceProxy Conversion Error
Hi GuysI am just trying to send a XML to a webservice method and getting the follow error :[xml] $Xml = get-content c:\test\testxml.xml$svc = New-WebServiceProxy -Uri...
View ArticleGet size of a dynamic Hyper-V disk drive?
Hi!Trying to get the size of all my Hyper-V hosts disks. I don't want the actually size it is allocating on disk but the maximum size it have inside the OS.I can't find that property in any powershell...
View Articlescript to find runas accounts of all schedule tasks
how do I find all the schedule tasks on my machines showing their runas accounts?
View ArticleImport Bulk users using IMPORT-CSV, export results to file
So i can successfully import users to AD using the syntax below, but while it is running, i see 'errors' on accounts that already exists in AD. How do i get it to export those duplicates/ errors to a...
View ArticlePowershell vs IE F12 Developer Tools
Why can I not acess the DOM of frames with PowerShell, but I can through F12 Developer Tools?document.frames[0].document.getElementById("expample").innerHTML "Page Content"$ie.document.frames -eq $null...
View Articlehow to run PS on other machines?
I have two questions. The first one is driving me nuts. I have a servers.txt file. It has server names and driver letters. Example: \\Server1\d$ \\Server2\d$ and so on. I want to read this...
View Articleemail on windows server 2012 through Powershell
I'm trying to send an email through Powershell 3.0 in Windows Server 2012. I'm entering send-mailmessage -to "email address" -from "email address" -subject "Test" -body "This is a test."I'm getting the...
View Articleinvoke-expression and passing variables (local computer no remote session)
Newbie here on PS… Here’s the sample code… $a = “Litware” $cmd = “.\$a.helloworld.ps1” Invoke-expression $cmd Fails with “….the term ‘.\litware.helloworld.ps1’ is not recognized as the name of a...
View ArticleAdd alert
I have the below powershell script can do the attribute update every day , it works fine , can advise if I would like the windows server send the alert to my exchange email a/c to display what user...
View ArticlePowershell Invoke-Sqlcmd error
When running a SQL query within SQL it runs fine. When running it within Powershell with the Invoke-Sqlcmd statement it returns the error: "A column named '***' already belongs to this DataTable". Is...
View Articleget last loggd on user on machine
I got a machine that i need to find the current o last logged on user on this machine.any idea how?I am using get-qadcomputer
View ArticleAccess denied when remotely trying with Get-NlbClusterNode
When I locally, on the SMTP Cluster run this command:Get-NlbClusterNode I get the output I need.But if I try the same from a remote server (same network and domain) I get an:[smtp-s001a]: PS...
View Articlepowershell solution for extracting data from txt file.
I am looking for a solution using powershell and perhaps using regex? This is new to me. In the text below I want to search between the word "Directory" and the word "bytes" for the inclusion of...
View ArticleHow to set static IPs to Team interface while creating a team in powershell?
Hi,I am trying to automate the NIC teaming process. I have a server with a broadcom 1gb NIC with 2 ports and both the ports have been assigned static IPs. I login to the server using ssh and create a...
View ArticleAdd alert
I have the below script which run on powershell to update the user attribute . get-qaduser -sizelimit 999999 | foreach { $upn = $_.userprincipalname $username = $samAccountName $emaildomain =...
View ArticleNot able to access shared location on Remote Server
I am new to power-shell and getting one problem. My problem is :- I have to get the folders/files from shared location to local machine (Machine 1). I have written this script in power-shell file and...
View ArticleRun Powershell script as Scheduled task, that uses Excel COM object
What am I missing here.. I have Powershell script that uses the Quest AD cmdlets to get computer information from AD and populate an Excel spreadsheet with the data.The script works fine, so I created...
View Article