Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.
Public Shared Function IsMemberOfGroup(userName As String, machineName As String, memberGroup As String) As Boolean Dim isMember As Boolean = False Using rootContext As New PrincipalContext(ContextType.Machine, machineName), _ grp As GroupPrincipal = GroupPrincipal.FindByIdentity(rootContext, memberGroup), _ usr As UserPrincipal = UserPrincipal.FindByIdentity(rootContext, IdentityType.SamAccountName, userName) If grp IsNot Nothing AndAlso usr IsNot Nothing Then ' Check if the user is a member of the group. isMember = grp.GetMembers(True).Contains(usr) MsgBox("yay") Else isMember = False MsgBox("nah") End If End Using Return isMember End Function
IsMemberOfGroup(localusrname, TextBox1.Text, "administrators")
|VB.net Refreshing SQL Views when new columns are added to a table||5||25|
|Check if number is currency||15||29|
|Help with sending PDF contents to server when Hyperlink Clicked.||5||14|
|Vb.Net Date Formatting Assistance||4||12|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!