Archive

Archive for the ‘Server 2008 R2’ Category

If the folder exist, appy the .reg file

27 August 2018 Leave a comment

Klasör varsa, .reg dosyasını uygulayın.

regedit

Bazı uygulamaları makine kurduktan sonra ayarlarını her makinede tek tek yapmak gerekebilir. Yada aşağıdaki gibi bir script ile, eğer yüklediğimiz uygulamanın klasörü makinede var ise ayarları Regedit’e yükleyen daha hızlı bir yöntem seçebiliriz.

After installing some applications on the computers, you may need to adjust the settings of the applications one by one. Or, with a script such as the following, we can choose a faster method that installs the settings into Regedit if the machine has the application folder.

Senaryomuz, eğer makinede 32bit Program Files klasörü var ise 32bit ayarların olduğu .reg dosyası uygulansın. Yoksa, 64bit .reg dosyası uygulansın.

Scenario, if you have 32bit Program Files folder on your machine, apply .reg file with 32bit settings. If not, apply 64bit .reg file.

VBScript

‘Script Start here

Dim objFSO

Set objFSO = CreateObject(“Scripting.FileSystemObject”)

Set oShell = CreateObject(“Wscript.Shell”)

‘———————————————————————————-

‘reg dosyalari belirlendi

‘reg files determined

‘———————————————————————————-

sRegFilepfx86 = “settingsrunx64.Reg”

sRegFile = “settingsrunx86.Reg”

‘———————————————————————————-

‘klasorler varmi kontrol ediliyor

‘Folders checking if exist

If objFSO.FolderExists(“C:\program files (x86)”) Then

MsgBox “C:\program files (x86) folder exists!”

oShell.Run “regedit.exe /s ” & Chr(34) & sRegFilepfx86 & Chr(34), 0, True

Else

MsgBox “C:\program files (x86) doesn’t exists!”

oShell.Run “regedit.exe /s ” & Chr(34) & sRegFile & Chr(34), 0, True

End If

‘———————————————————————————-

‘Script Finish here

İyi Eğlenceler!

Enjoy!

 

Advertisements

Create a shortcut with script

13 August 2018 Leave a comment

I create a shortcut with a script, but why? Some applications do not know the cause, do not create a shortcut during installation or after installation. The following Script allows you to create shortcuts with the variables entered.

VBScript

The shortcut name, shortcut path, file name of the target application, shortcut icon, and system architecture are automatically selected.

Script

‘Script Started

‘Option Explicit

‘Create Shortcut

strComputer = “.”

On Error Resume Next

Dim objShell, objDesktop, objLink, strDesc,objItem ,colItems

Dim strAppPath, strWorkDir , WshShell

Set WshShell     = Wscript.CreateObject(“Wscript.Shell”)

Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)

Set colItems = objWMIService.ExecQuery(“Select * from Win32_ComputerSystem”,,48)

For Each objItem in colItems

If objItem.SystemType = “x64-based PC” Then

‘Variables

strWorkDir =”C:\”

strAppPath = “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”

strDesc=”Google Chrome”

‘——

Set objShell = CreateObject(“WScript.Shell”)

objDesktop=objShell.SpecialFolders(“Desktop”)

Set objLink = objShell.CreateShortcut(objDesktop & “\Google Chrome.lnk”)

objLink.Description = strDesc

objLink.TargetPath = strAppPath

objLink.WindowStyle = 3

objLink.WorkingDirectory = strWorkDir

objLink.IconLocation = “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”

objLink.Save

‘————————————-‘

‘ Add Registry key

else

‘Variables

strWorkDir =”C:\”

strAppPath = “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”

strDesc=”Google Chrome”

‘——

Set objShell = CreateObject(“WScript.Shell”)

objDesktop=objShell.SpecialFolders(“Desktop”)

Set objLink = objShell.CreateShortcut(objDesktop & “\Google Chrome.lnk”)

objLink.Description = strDesc

objLink.TargetPath = strAppPath

objLink.WindowStyle = 3

objLink.WorkingDirectory = strWorkDir

objLink.IconLocation = “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”

objLink.Save

end if

next

wscript.quit

‘Script Finished

Enjoy!

 

 

Find files easily with simple batch file

04 August 2018 Leave a comment

Knowing the files on computers is one of the issues that every system administrator usually deals with. You can easily learn it by creating a simple batch command with the following commands.

open Notepad and copy following commands and paste in this note file.

echo %SystemRoot%\Security\logs\scecomp.dat > c:\%computername%.txt
dir %SystemRoot%\Security\logs\scecomp.dat >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\System32\iapfltr.dat >> c:\%computername%.txt
dir %SystemRoot%\System32\iapfltr.dat >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\Security\logs\sceRoot.dat >> c:\%computername%.txt
dir %SystemRoot%\Security\logs\sceRoot.dat >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\Security\logs\sceback.old >> c:\%computername%.txt
dir %SystemRoot%\Security\logs\sceback.old >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\Security\logs\scesetup.dat >> c:\%computername%.txt
dir %SystemRoot%\Security\logs\scesetup.dat >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\System32\ntsec.dat >> c:\%computername%.txt
dir %SystemRoot%\System32\ntsec.dat >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\System32\cacls.exe >> c:\%computername%.txt
dir %SystemRoot%\System32\cacls.exe >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\System32\Drivers\cacls.exe >> c:\%computername%.txt
dir %SystemRoot%\System32\Drivers\cacls.exe >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\System32\drivers\adpu160.sys >> c:\%computername%.txt
dir %SystemRoot%\System32\drivers\adpu160.sys >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\System32\adpu160.sys >> c:\%computername%.txt
dir %SystemRoot%\System32\adpu160.sys >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\System32\Drivers\adpu160.sys >> c:\%computername%.txt
dir %SystemRoot%\System32\Drivers\adpu160.sys >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\IME\IMESC5\DICTS\PINTLGBS.IMD >> c:\%computername%.txt
dir %SystemRoot%\IME\IMESC5\DICTS\PINTLGBS.IMD >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\Security\logs\sceback.old >> c:\%computername%.txt
dir %SystemRoot%\Security\logs\sceback.old >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\system32\desk.cfg >> c:\%computername%.txt
dir %SystemRoot%\system32\desk.cfg >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\IME\IMESC5\DICTS\PINTLGBP.IMD >> c:\%computername%.txt
dir %SystemRoot%\IME\IMESC5\DICTS\PINTLGBP.IMD >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\system32\svcsstat.exe >> c:\%computername%.txt
dir %SystemRoot%\system32\svcsstat.exe >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\system32\winhttpc.dll >> c:\%computername%.txt
dir %SystemRoot%\system32\winhttpc.dll >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo svcsstat.dll /s >> c:\%computername%.txt
dir svcsstat.dll /s >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\system32\wshnetc.dll >> c:\%computername%.txt
dir %SystemRoot%\system32\wshnetc.dll >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt
echo %SystemRoot%\SysWow64\wshnetc.dll >> c:\%computername%.txt
dir %SystemRoot%\SysWow64\wshnetc.dll >> c:\%computername%.txt
echo —————————————————— >> c:\%computername%.txt

save_as_batch_file

Save as findfiles.cmd to Desktop

run_as_administrator

open cmd as Administrator

deskto_cmd

navige to Desktop and run the batch file

system_root

The file created with the machine name will appear in the root directory.

batch_file_output

Enjoy!

Problems refreshing icons on desktop and system tray (Solution)

I have come across a problem with a few customers, at least a couple of machines, with the problem of not refreshing the System Tray ( right next to the clock wlEmoticon-winkingsmile.png ) and the desktop icons.

2018-07-16_14-21-29

You can simply solve this problem by following the steps below.
Lets start,

To refresh system tray icons;

HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify

find and delete IconStreams ve PastIconStream variables on the right pane,

2018-07-16_14-28-08

Ctrl-Alt-Delete and open Task Manager, select explorer.exe under Processes and Finish Process.

Click Applications, select New Task, type explorer.exe and press Enter.

To refresh the desktop icons;

C:\Users\<user name>\AppData\Local
go to folder, delete the hidden IconCache.db file, and then restart the computer.

Enjoy.

Access useful information from the SCCM’s DB #1

There were thousands of machines in the majority of the large companies I consulted and they wanted to follow these machines with SCCM. Reports that are available in the SCCM sometimes may not provide enough information. In such cases the solution comes with Microsoft SQL Management Studio. If you are a system administrator, you will find yourself writing SQL 🙂

Microsoft SQL Server Management Studio 17

I’m not sure if I can help you write SQL, but I have a lot of ready-made SQL that my customers like a lot. I plan to share these with you one by one. Most of my customers wanted a report like the one below. I have changed the report according to the wishes of the years and I share the final status with you.

Read more…

Windows Time Zones

When you need change time zone in Windows operating system,  you need to see how many time zone supported by your current operating system. You can use the following easy CMD command for get full list of time zones.

tzutil /l

Read more…

Server 2008 R2 Terminal Server License Server 120 gün kaldı ve 2 kullanıcıdan fazla oturuma izin vermemesi. / Server 2008 R2 Terminal Server License Server has 120 days left and does not allow more than 2 users to log on.

13 January 2011 7 comments

 

TS etkinleştimesini yaptınız, CAL’lar eklendi, fakat TS 120 günden geri saymaya devam ediyor veya 2 kullanıcıdan fazla kullanıcı oturum açmak istediğinde “bir kullanıcının oturumunu kapatın” diye uyarı alıyorsanız, bu sorunu aşağıdaki adımları uygulayarak çözebilirsiniz.

You have activated TS, you receive CALs added but Terminal Services continues to count down from the 120 days, or if you are prompted to “log out of a user” when more than 2 users want to log in, you can solve this problem by following these steps.

Read more…