PowerShell remoting fails to move a VM from one host to another host
This is for Hyper-V 2012 servers under Windows 2003 domain. CredSSP is not supported.This command works:move-vm -name vm1 -computername hypervA -destinationhost hypervBThis one is not working:$pss =...
View ArticleInvoke-command against a server works from laptop, but not from another server
I am trying to run a powershell command against a remote server. Basically I have a Orchestrator runbook that runs a powershell script against a remote server using the invoke-command. The script...
View Articlewho created that share?
I have been tasked with a project to discover who created a share and when they created it.Is there a way in Powershell to find this information?TIA - OldDog
View ArticleExport WSB-logs using PowerShell
Hello,i am trying to find a solution to export the Windows Server 2008r2/2012 Windows-Server-Backup logs WITH content of the message to a .txtI have found this :Get-WinEvent -logname...
View ArticleHow to pass a property of an object as ref?
Hello,i have created an object like so: $global:user = new-object -typename psobject Add-Member -InputObject $global:user -Name new -value "0" -membertype noteproperty add-member -inputobject...
View ArticleHow can I find User accounts which run with Local System privileges in my...
Hello,For audit pursposes, we need to report User accounts which run with the Local System privileges in the Domain and on Domain Controllers. Can the Get-ADuser cmdlet help me here? Any...
View ArticleHow to redirect and append output to a log file from the copy-item -verbose...
(1) I am not using powershell 3.0 so cannot use 4>&1 > $LogFileName(2) Tried using Start-Transcript and Stop-Transcript but still the output is sceen on the screen. Below is the...
View ArticleCheck Whether drive exists
function get-checkdrive($server) { write-verbose "check drive -started" $check= 'D:\' # no escape $testobj=get-wmiobject win32_volume -filter "DriveLetter= 'D:'" -computername $server $caption=...
View Articlenot finding RDSConfiguration in Remote desktop services
when i go to cd RDS: and do DIR i see only LicenseServer not RDSConfiguration because of which i am not able to go to RDSConfiguration and change the session limits. Please refer the image for more...
View Articlecheck user account control enabled or not ?
$servers="DEN-DC-01", "DEN-GW-01", "DEN-SRV-01","DEN-SRV-02","FTC-CL1-01" Function get-UserAccountControl ($server) { $uac=(Get-ItemProperty...
View ArticleFind and Replace using RegEx
Can anyone help?I have a script to find a regex of information, my question is :- can I replace the items matched with with another regex?such as ... $item -replace $regex , $regex2or with an array, so...
View ArticleDoes Update-Help actually run only once a day unless the -force switch is used?
From the Get-Help for Update-Help"You can even automate the running of Update-Help by adding an Update-Help command to your Windows PowerShell profile. By default, Update-Help runs only once per day on...
View ArticleClear an event log with specific ID using Powershell
Hi,I need to do a search in system or security logs and find a special ID log (for example event id : 1022) and clears all of those logsi tested Get-EventLog "System" | Where-Object {$_.EventID -eq...
View ArticleSimple Progress Bar
HiI am trying to get a progress bar working in my form, not having much luck. I have started a small basic script to help me better understand the functions of progress bars in forms, but even this is...
View ArticleValue cannot be null For Parameter name: serverSettings
Here i create a new session and run the poweshell cmdlets in that session, Cmdlets, $s=New-PSSession -ComputerName "Name" [Here the session gets created] invoke-command -Session '$s-...
View ArticleAble to contact C# web service from C# applciation but not powershell
Hi All,I've been trawling the web but can only find detailed information on how to use powershell from C# but not the other way round.Basically i have a web service that imports or removes a machine...
View ArticleMerginng 2 *.htm file
Hello Experts,I am in a situation where I need to merge multiple HTML files to one file and send the report to the management.Now I was unable to figure out hte way to merge 2 html files using...
View ArticleScript block literals are not allowed in restricted language mode or a Data...
Here i execute power shell Scripts by using in C#:PSCredential psc = new PSCredential(@"domainname\username", SecurePswd); WSManConnectionInfo wsmConn = new WSManConnectionInfo(new Uri(strSystemURI),...
View Articlemoving mailboxes to another database increase the RPC load
moving mailboxes to another database increase the RPC load I need to do this because a mailbox database called C has high white space 30 GB ,I need to create a new database and move the content of...
View ArticleHow to move huge amount of folders to limited number of folders
Dear PS gurus,I tried to searched my question online but didn't get what I need.Thanks very much:Suppose there are lots of folders insides a root folder(namely, D:\) with different sizes (but all less...
View Article