Thanks for the code and it looks like the code should work but the three varables you suggested are coming back NULL. Even though the variable that I am setting them too is not null but equals the Path \\10.60.216.30\Backups$\cnu14171bg.
$btnBrowse_Click = {
$folderbrowsermoderndialog1.SelectedPath = $textPath.Text
if ($folderbrowsermoderndialog1.ShowDialog() -eq 'OK')
{
$txtPath.Text = $folderbrowsermoderndialog1.SelectedPath
$myPath = $folderbrowsermoderndialog1.SelectedPath
$server, $share, $folders = ($myPath).Split('\', [StringSplitOptions]::RemoveEmptyEntrie)
# $server, $share, $folders = ('\\10.60.216.30\Backups$\cnu14171bg').Split('\', [StringSplitOptions]::RemoveEmptyEntries)
$oldComputerName = $folders
$oldDistinguishedName = Get-dn computer cn $oldComputerName
$global:oldComputerObject = Get-ADObject ($oldDistinguishedName)
$organizationalUnit = Get-ADObject "OU=Agencies, DC=state, DC=in, DC=us"
}
}
Is there something I am missing here?
Where $myPath = \\10.60.216.30\Backups$\cnu14171bg
$server = Null
$share = Null
$Folder = Null