Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Browsing all 8411 articles
Browse latest View live

Script to detect when Netbios name different than DNS name

Thank you for reading this.I am a PS greenhorn so please help with:I need a PS script which loads a txt list of computers one per line and identifies, redirecting to a text file same format, which...

View Article


Moving computer to new OU

$Find = Get-ADComputer MG10011001Write-host $FindMove-ADObject $Find -TargetPath "OU=MGH_USERS,DC=Acme,DC=org" When I run the above code it completes without error but it does not move the machine....

View Article


Mailbox Search

Search-Mailbox -Identity "Joe Healy" -SearchQuery 'Subject:"Project Hamilton"' -TargetMailbox "DiscoveryMailbox" -TargetFolder "JoeHealy-ProjectHamilton" -LogLevel FullAbove command return all messages...

View Article

powershell script to find a process is running or not

Hi Friends, I am new to this forum.  I have a small requirement.I want to do the following: 1. I want to check a process and stop it gracefully 2. If the process does not stop gracefully after 5 mins...

View Article

Reverse lookup on archive mailbox

Hi All, hope you're well.Wondering if anyone knows how to do a reverse look up on a an archive mailbox.So if you do a Get-Mailboxstatistics-Database DatabaseNameon a mailbox database that has Exchange...

View Article


Start-BitsTransfer: Cannot Find Path

I want to copy one zip file from my local system to the Server machine. So I am using the Powershell Command Start-BitsTransfer -source c:\file.zip -destination  \192.168.1.210\C$\Website -credential...

View Article

The specified path, file name, or both are too long.

I try to copy three kind of files to a remote location. I've tested it on my own computer and on a server and everything works fine BUT on the computer I actually should execute this script.I already...

View Article

how to recreate undelivered email report?

anyone have script to create undelivered emails report? I am looking for daily report for yesterday with sender and failed receipent.now i can view them from message tracker by doing DSN search and...

View Article


DistinguishedName

$GetName = (get-ItemProperty hklm:\SOFTWARE\Microsoft\MPSD\OSD).OSDComputerName$Find = Get-ADComputer ($GetName).DistinguishedName$Find On line 2 above I've also tried   $Find = Get-ADComputer...

View Article


PowerShell Snippets Pt. 2

Some more PowerShell snippets.Read More

View Article

creating a function on Invoke-SqlCmd and having Troubles with UserName /...

Hi all, so im building some functions in powershell where i need to choose between Windows or SQL authentication, so im trying to put that into my scripts but having a couple of issues..  My current...

View Article

Need help with regex

I have files with content similar to one below:SN1,Column2,Column3;SN2,Column2,Column3;SN3,Column2,Column3;SN1,Column2,Column3;SN2,Column2,Column3;I need to create a PS script which will perform some...

View Article

Upload File FTP

I am building a script that takes a file and then uploads it FTP. The problem I am having is I keep getting an error 530. Here is the function I created to do this. Note I xxx in sensitive data...

View Article


Syntax trouble when pulling data from a query in sql

The top portion of my code is working beautifully. For some reason I am have trouble with the code i have bolded below. What I am trying to do is select the field called path from the sql server, then...

View Article

Powershell workaround for File Folder names that are too long...

Hi,is there any current update on the limitations in Powershell concerning the File FullName/Folder names being more than 260/248 chars?I've found this post, but I'll admit it's a bit...

View Article


Creating a Generation 2 Disk with PowerShell

When Windows Server 2012 R2 hit the datacenter, and with it a new version of Microsoft Hyper-V, it offered the option to create a new kind of virtual machine. These “Gen 2″, or generation 2, virtual...

View Article

I want to run a script on multiple servers(nearly 40-50 servers) parallely

I'm trying to execute an existing script on a remote server and capture the output in a local filefavorite$Username = "user"$Password = "Password" $servers = get-content "c:\temp\servers.txt" $sb =...

View Article


Running "WinRM QuickConfig" against Remote Machines and Remotely-Enabling,...

I am still learning my way around PowerShell, but getting a bit better everyday, things are looking up. One of the issues that my team and I are facing is Remote Management of domain level machines. A...

View Article

Putting two scripts together

I have a script that will Ping a machine and report if it is online or offline code below:<#Title: Ping-TestAuthor: William H. DavisCreated: 5-May-2014Synopsis: This script will ping a remote...

View Article

Running a script as a different user

Hey all, Im having trouble with something i thought i would be pretty easy. but i keep failing short it seems. We have several domains in our shop, so im trying to run scripts on my machine that...

View Article
Browsing all 8411 articles
Browse latest View live