×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Checking Bitlocker status on a computer list

Checking Bitlocker status on a computer list

Checking Bitlocker status on a computer list

(OP)
Hi all
I'm not used to using powershell compared to batch files. What i'm trying to do is script some results using manage-bde (is on my Win10 PC and seems to be standard, but isn't on our 2012 server?) to show the Encryption status of all PCs in a text list.
So far I've ended up with the following PS1

CODE

$InputFile = "\\server\share name\folder\ComputerList.txt"
    #Read in the contents of the file
    $hostnames=get-content $InputFile
    #Loop through the list of hostnames one at a time
    ForEach ($hostname in $hostnames)
    {
        #Check the Encryption Status of the C: drive, filter to the Conversion Status line
        $EncryptionStatus=(manage-bde -status -cn "$hostname" C: | where {$_ -match 'Conversion Status'})
        #Check a status was returned. 
        if ($EncryptionStatus)
        {
            #Status was returned, tidy up the formatting
            $EncryptionStatus=$EncryptionStatus.Split(":")[1].trim()
        }
        else
        {
            #Status was not returned. Explain why in the output
            $EncryptionStatus="Not Found On Network (or access denied)"
        }
        #Format the output object. 2 fields "Hostname" and "Status"
        [pscustomobject][ordered]@{
                    'Hostname'=$Hostname;
                    'Status'=$EncryptionStatus;
        }
    }#End of Loop through Hostnames 
If I rightclick-run-in-powershell it on the sever (logged in as my "admin" acc that isn't actually an admin on the server) it says manage-bde isn't available (doesn't seem to be in the 2012 OS).
If I rightclick-run-in-powershell it on my local PC (as my non-admin acc) it takes a while and then starts giving me the results saying it's not available - even on a test laptop sat next to me available.
If I open CMD as admin and then run the ps1 from there, it works correctly and gives correct results on my test laptop that is available.
So I made a BAT file saying

CODE

powershell -noexit "& ""\\server\share name\folder\checklist.ps1"""
pause 
(I forget where I got the formatting for that to make it work because by default I would've just put "powershell \\path\scriptname.ps1" myself)
If I run the BAT file on my local PC (as non admin) it does the same as when I rightclick-run-in-powershell the PS1 - takes a while and gives failing results.
If I rightclick-run-as-admin the BAT file, it flashes a window up that instantly closes.

Has anyone got any idea how I can do what felt like a relatively simple requirement for Bitlocker status checking on multiple remote machines that may or may not be connected at the time?
It would be nice if it ran on the 2012 server, but running on our local machines is ok as long as the onlyl requirement would be right-clicking a bat and running as admin (no simple run-as-admin options when clicking a PS1)

_________________________________
Leozack

CODE

MakeUniverse($infinity,1,42); 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close