Skip to main content

Posts

Showing posts from 2017

How to configure banner in linux

run below cmd to set the banner vi /etc/issue.net after that in vi editor please type your customized Banner save the file using esc + wq! now open the ssh configuration file vi /etc/ssh/sshd_config now search and remove #in front of "banner" word and provide the path to issue.net as replacement of current one Banner /etc/issue.net now run the below cmd  /etc/init.d/sshd  restart

vb script to get details of folders and sub folders

Wscript.Echo "begin." Set objFSO = CreateObject("Scripting.FileSystemObject") Set objSuperFolder = objFSO.GetFolder(WScript.Arguments(0)) Call ShowSubfolders (objSuperFolder) Wscript.Echo "end." WScript.Quit 0 Sub ShowSubFolders(fFolder)     Set objFolder = objFSO.GetFolder(fFolder.Path)     Set colFiles = objFolder.Files     For Each objFile in colFiles         'If UCase(objFSO.GetExtensionName(objFile.name)) = "PDF" Then             Wscript.Echo objFile.Name        ' End If     Next     For Each Subfolder in fFolder.SubFolders         ShowSubFolders(Subfolder)     Next End Sub *for getting Updates / if you are liking the posts and if this is useful Please follow the blog*

VB script to find the Disk Space

Option Explicit const strReport="c:\output.txt" const sFile ="c:\input.txt" Dim objWMIService, objItem, colItems Dim strDriveType, strDiskSize, txt Dim oFSO, oFile, sText,strComputer Set oFSO = CreateObject(“Scripting.FileSystemObject”) Dim objFSO,objTextFile Set objFSO = createobject(“Scripting.FileSystemobject”) Set objTextFile = objFSO.CreateTextFile(strReport) If oFSO.FileExists(sFile) Then Set oFile = oFSO.OpenTextFile(sFile, 1)  Do While Not oFile.AtEndOfStream   sText = oFile.ReadLine    If Trim(sText) <> “” Then           strComputer=sText               Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)               Set colItems = objWMIService.ExecQuery(“Select * from Win32_LogicalDisk WHERE DriveType=3”)              txt = sText & vbtab & “Drive” & v...

VB Script to stop particular services

Set oshell = createobject("Wscript.Shell")     oshell.run"cmd.exe"     wscript.sleep 500     oshell.sendkeys "net stop "" Service name """+("{Enter}")     wscript.sleep 5000 *for getting Updates / if you are liking the posts and if this is useful Please follow the blog*

VB script to monitor Performance

strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set objRefresher = CreateObject("WbemScripting.SWbemRefresher") Set objProcess = objWMIService.ExecQuery _     ("Select * From Win32_PerfFormattedData_PerfProc_Process where Name='EPDServer.exe*32'") Set colItems = objRefresher.AddEnum _     (objWMIService, "Win32_PerfFormattedData_PerfProc_Process").objectSet objRefresher.Refresh For Each objItem In objProcess If LCase(objItem.Name) = "hs5" Then Wscript.Sleep 500 While objItem.PercentProcessorTime <> 0 Wscript.Sleep 500 objRefresher.Refresh WEnd End If Next *for getting Updates / if you are liking the posts and if this is useful Please follow the blog*

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 = No...

VB script to find memory usage of each services

Set objWMI = GetObject("winmgmts:\\.\root\cimv2") Set colObjects = objWMI.ExecQuery("Select * From Win32_Process") For Each Item in colObjects Item.WorkingSetSize=Item.WorkingSetSize/1024*1024     WScript.Echo Item.Name & " - " & Item.WorkingSetSize Next *for getting Updates / if you are liking the posts and if this is useful Please follow the blog*

Resetting ubantu passwords

By default the first user's account is an administrative account, so if the UI is prompting you for a password it's probably that person's user password. If the user doesn't remember their password you need to reset it. To do this you need to boot into recovery mode. Boot up the machine, and after the BIOS screen, hold down the left Shift key. You will then be prompted by a menu that looks something like this: I've noticed on some systems that timing when to hit the left Shift key can be tricky, sometimes I miss it and need to try it again. Hit the down arrow until you select the 2nd entry from the top (the one with the recovery mode in the description) and then hit Enter. Now you should see this menu: Using the arrow keys scroll down to root and then hit Enter. You should now see a root prompt, something like this: root@ubuntu:~# At this stage you should have a read-only filesystem. You have to remount it with write permissions: mount -o rw,remou...