Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

problem getting loginhours for users

$
0
0

when i do it one at a time it works

$vUser=[ADSI]"LDAP://CN=mylastname\, myfirtname,OU=S99X01,OU=Field Offices,DC=mydomain,DC=int"
$vHours=$vUser.loginhours
$vUser.path
$vHours

works just fine

but

$vLdap='LDAP://'
$vQuote='"'
$vAdsi='[ADSI]'
foreach($_ in(get-qaduser *|select dn))
    {
    $vUser=$_.dn
    $vUser=$vAdsi+'"'+$vLdap+$vUser+'"'
    $vLoginHours=$vUser.loginhours
    $vUser
    $vLoginHours
   
    }

and i get no joy...

help please? it is driving me crazy, i have tried many small changes but nothing seems to work

i even write-host for the var's and i dont see the dif, so why not work?

 

thx

bob


Viewing all articles
Browse latest Browse all 2562

Trending Articles



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