Hello,
please I need to help, to understand how to filter the output, I show you an example, I am using this simple script:
import-module ActiveDirectory
Get-ADUser -Filter {enabled -eq "true" -and SamAccountName -like "i*"} | ForEach-Object {
$usr = [ADSI]"LDAP://$($_.DistinguishedName)"
$old_Profile_path = $usr.psbase.InvokeGet("terminalservicesProfilepath")
If ($old_Profile_path -notlike ""){
Write-Host $($_.SamAccountName) $old_Profile_path
}
else
{
Write-Host $($_.SamAccountName) "ProfilePath empty"
}
}
the output is like this:
IWT0038 \oldshare\ProfileDir$\IWT0038
IWT0064 \oldshare\ProfileDir$\IWT0064
IWT0087 \newshare\farm_xd_mt$\IST\PROFILE_DIR\IW\IWT0087
my scope it is to obtain only the "newshare" rows, I tried the findstr unsuccesfully.
I am not a very skilled scripter, thank you very much for the help
regards