Saving a Hash to a file and getting back a hash
Hi,If I extract AD property of a user to a file with this commandline:$san = 'user' $getad = (([adsisearcher]"(&(objectCategory=User)(samaccountname=$san))").findall()).properties $getadThen if...
View ArticleRemove-Item vs Delete
I want to delete all text files in a given folder and I think this will do the trick Remove-Item "C:\MyTemp\*.txt"I also noticed that piping Get-ChildItem to get-Members shows the Delete...
View ArticleRetrieves a list of personal virtual desktops and associated user accounts
Hi All,I am trying to Retrieves a list of personal virtual desktops and associated user accounts using PS command, Export-RDPersonalVirtualDesktopAssignment -CollectionName "XYZ" -Path...
View ArticleAdd-MailboxPermission for Office 365 mailboxes error
Hi,I have a hybrid Exchange 2010 / Office 365 environment. I am getting errors when trying to grant full access for groups to mailboxes in Office 365.I am using this line:Add-MailboxPermission...
View ArticleMonitoring event logons. Please help a noob.
Good afternoon/morning/evening and other.I have managed to smash together a very clunky script that monitors for an event id that stops a terminal server and then reports out it's failed. It took me a...
View Articlejust need little help to change script
Hello,I have a script to save my servers and it works very well.But on one server, i have ISCSI connected and i dont want the script save the ISCI hard disk, just the C: and system state How to change...
View ArticleNot able to access Outlook COM Object's properties in Background jobs
Hi,I have a main script in which I have a custom collection where I will be storing config information andOutlook COM Object.I'm passing the custom collection's object as a parameter to the background...
View ArticleIssues performing actions with foreach (actions only being performed on local...
As a part of a system monitoring script I am unable to correctly identify the domains of a list of servers. Right now the segment looks like this: $Serverlistfile = "C:\complist.txt" $Serverlist =...
View Article[beginner] change subscription from e3 to e5
Hello. Could someone please help me with changing a subscription from E3 to E5? I know this can be done from the portal,but I want to do it from powershell. So far, I removed all licenses from E3 users...
View ArticleIs this expected beaviour of the switch statement or a bug?
When I use the pipe variable $_ in a switch statement it seems like after the switch evaluation the hashtable is stripped and only the value/key remains that was evaluated in the switch. So $_...
View ArticleGroup files that contain identical value in name‼ Why make simple things...
From SO: http://bit.ly/2gsZebdIsn't there a simple solution?After all, we have PowerShell right beneath our finger tips at the keyboard‼ (*)(*) except me, because I don't have PowerShell‼ ( but accept...
View ArticleFormatting Select-Object Output
Hello,I'm a fairly new user to powershell and seem to be stuck.I am trying to format a field of "Select-Object" data but can seem to work out how:$os | select @{Name = "Status";Expression = {$Status}},...
View ArticleUnable to perform remote foreach
As a part of a system monitoring script I am unable to correctly identify the domains of a list of servers. Right now the segment looks like this: $Serverlistfile ="C:\complist.txt" $Serverlist...
View ArticleExecute .sql file from local machine to server
Hello,I have a .sql file on my local machine and I need to execute this on a remote server. I am connected to the server but cannot seem to find the correct syntax. Here is what I...
View ArticleScript runs exponentially slower as scheduled task
I have a script that I've run a few times before using Citrix snapins. It runs just fine in the console, generally taking around 20 minutes. When I try to run it as a scheduled task, it never...
View ArticleDo the powershell scrypt work similarly at Windows XP and Windows 7,8,10...
Hello.Please tell, will one and the same powershell scrypt work similarly at a windows xp and Win7,8,10 computers? Will I need to add some additional coding for example to shutdown skype and start some...
View ArticleCan powershell application be launched at the virgin Windows XP?
HelloPlease tell, can powershell .exe application be launched at a virgin Windows XP OS without any additional software has to be installed?
View ArticleHow to pass the domain part of an email address to a variable
Let's say i want to capture an email address to a variable, then i want to take the part after the "@" and assign that to another variable. How?Write-Host "Enter Email Address" $mailbox =...
View ArticleHow to launch webserver without notifications from firewall?
Hello!Please tell, how to launch xampp web server without appearance of a firewall messages which tells that he blocked some functions of Apache and Mysql servers in all public and private networks?...
View ArticlePowershell to create bulk user from a CSV file to other domain that what you...
Hi All,i am trying to create a bulk of users from a CSV file in to other domain than what i am logged in to. Our company has our old domain and we are in process of the migration. i am currently...
View Article