Skip to main content

VB script Getting members of a particular group in AD


Dim objGroup, objUser, objFSO, objFile, strDomain, strGroup, Domain, Group, objFolder, OpenCMD, f

strDomain = Inputbox ("Enter the Domain name", "DB Data Exporter", "Enter domain name")

strGroup = InputBox ("Enter the Group name", "DB Data Exporter", "Enter group name")
Set objFSO = CreateObject("Scripting.FileSystemObject")


Dim
OpenCMD = CreateObject("wscript.shell")

set f="dsget group"+
OpenCMD.run(

'Set objFolder = objFSO.CreateFolder("D:\eis"&s)
'Set objFile = objFSO.CreateTextFile("Path for keeping file"&strGroup&".csv")
'Set objGroup = GetObject("WinNT://" & strDomain & "/" & strGroup & ",group")
'objFile.WriteLine "EMP ID"
'For Each objUser In objGroup.Members
 '   objFile.WriteLine objUser.Name
'Next
'objFile.Close
'Set objFile = Nothing
'Set objFSO = Nothing
'Set objUser = Nothing
'Set objGroup = Nothing
Wscript.Echo "Please find the output is created "




*for getting Updates / if you are liking the posts and if this is useful Please follow the blog*

Comments

Popular posts from this blog

restart services remotely using power-shell script( restart.ps1)

FUNCTION Restart-Service { PARAM([STRING]$SERVERNAME=$env:COMPUTERNAME,[STRING]$SERVICENAME) #MSSQLSERVER FOR DEFAULT INSTANCE FOR NAMED INSTANCE MSSQL`$KAT $SERVICE = GET-SERVICE -COMPUTERNAME $SERVERNAME -NAME $SERVICENAME -ERRORACTION SILENTLYCONTINUE IF( $SERVICE.STATUS -EQ "RUNNING" ) { $DEPSERVICES = GET-SERVICE -COMPUTERNAME $SERVERNAME -Name $SERVICE.SERVICENAME -DEPENDENTSERVICES | WHERE-OBJECT {$_.STATUS -EQ "RUNNING"} IF( $DEPSERVICES -NE $NULL ) { FOREACH($DEPSERVICE IN $DEPSERVICES) { Stop-Service -InputObject (Get-Service -ComputerName $SERVERNAME -Name $DEPSERVICES.ServiceName) } }   Stop-Service -InputObject (Get-Service -ComputerName $SERVERNAME -Name $SERVICE.SERVICENAME) -Force    if($?)    {    Start-Service -InputObject (Get-Service -ComputerName $SERVERNAME -Name $SERVICE.SERVICENAME) $DEPSERVICES = GET-SERVICE -COMPUTERNAME $SERVERNAME -NAME $SERVICE.SERVICENAME -DEPENDENTSERVICES | WHERE-OBJECT ...

Java functions to run SSH commands from java

     public static void SSH(String Host,String username,String passwor,String cmd,String cmd1) {   byte[] tmp = new byte[1024]; String host =Host; String user =username; String password =passwor; String  command = cmd;                 String ou=null; try { Properties config = new Properties(); config.put("StrictHostKeyChecking", "no"); JSch jsch = new JSch(); // Create a JSch session to connect to the server Session session = jsch.getSession(user, host, 22); session.setPassword(password); session.setConfig(config); // Establish the connection session.connect(); System.out.println("Connected..."); ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(command); channel.setErrStream(System.err);                         channel.connect();       ...

Disabling and enabling TLS

1.Press win+R 2.Type regedit 3.go to  Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS (version)\Client  Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS (version)\Server set the Dword value to 1 for enabling TLS client and 0 to disable enable TLS will make systems vulnerable