Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

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 Article


Invoke-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 Article


who 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 Article

Export 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 Article

How 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 Article


How 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 Article

How 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 Article

Check 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 Article


Image may be NSFW.
Clik here to view.

not 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 Article


check 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 Article

Find 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 Article

Does 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 Article

Clear 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 Article


Simple 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 Article

Value 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 Article


Able 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 Article

Merginng 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 Article


Script 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 Article

moving 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 Article

How 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
Browsing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>