Category Archives: Profile

Powershell Form – Send Encrypted PDF Form

Due to recent changes in global privacy and data protection laws ( GDPR & Israeli Privacy Law)

I had to find a quick and easy  way to send encrypted PDF files by email.
So, after 6 hours of searching and writing i finally managed to create a workaround

At first I found this Password Protect PDF document script:  https://efcomputer.net.au/blog/password-protect-pdf-document/ 
and i used a part of the code that responsible for encrypting the file (Thanks:) )

So the following PowerShell script will Encrypt PDF files and send them by Email.

There are two folders, one with an English based form and the other with an Hebrew based form.

It looks like this

English Form:

Hebrew Form:

Have fun 🙂

 

 

 

Who am I – VB Script

‘ This script returns the following details on the local computer:

1. IP address

2. Computer name

3. Last reboot time

4. user name

image

I compiled it to exe and push it to all the workstations using GPO

It looks like this

image

Copy and save as vbs file:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

 

Function WMIDateStringToDate(dtmBootup)
WMIDateStringToDate = CDate(Mid(dtmBootup, 5, 2) & “/” & _
Mid(dtmBootup, 7, 2) & “/” & Left(dtmBootup, 4) _
& ” ” & Mid (dtmBootup, 9, 2) & “:” & _
Mid(dtmBootup, 11, 2) & “:” & Mid(dtmBootup, _
13, 2))
End Function
Dim NIC1, Nic, StrIP, CompName, objWMIService, colOperatingSystems, dtmBootup,  dtmLastBootupTime

Set NIC1 = GetObject(“winmgmts:”).InstancesOf(“Win32_NetworkAdapterConfiguration”)

For Each Nic in NIC1

if Nic.IPEnabled then

StrIP = Nic.IPAddress(i)

Set WshNetwork = WScript.CreateObject(“WScript.Network”)

CompName= WshNetwork.Computername
end If

Next

Set objWMIService = GetObject(“winmgmts:” & strComputer & “\root\cimv2”)
Set colOperatingSystems = objWMIService.ExecQuery(“Select * from Win32_OperatingSystem”)
For Each objOS in colOperatingSystems
dtmBootup = objOS.LastBootUpTime
dtmLastBootupTime = WMIDateStringToDate(dtmBootup)

MsgBox “IP Address: “&StrIP & vbNewLine _
& “Computer Name: ” &CompName & vbNewLine _
& “Last Reboot Time: “&dtmLastBootupTime & vbNewLine _
& “User Name : “& WshNetwork.UserName
‘MsgBox “Last Reboot: ” & dtmLastBootupTime
‘MsgBox “The current user is ” & WshNetwork.UserName

wscript.quit
Next

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Good luck סמיילי

Welcome to My blog

My name is Idit bnaya,

I work as a Microsoft  Infrastructure Consultant ,I created this blog to provide and share useful information .

 

Hope you found it helpful

Idit.

Note: All posts on this blog is my personal opinion, and is provided “as is”. I do not give any warranties or take responsibility for any errors that might occur