PowerShell: How to find whether the machine is waiting for Restart

One of the biggest problems of many system administrators is to restart the machines on the network. So how do we get this information, and how can this information help us?

The machine is waiting for restart, you can reach it simply by using the PowerShell command below.

2018-09-27_17-00-23

Invoke-WmiMethod -Namespace "ROOTccmClientSDK" -Class CCM_ClientUtilities -Name DetermineIfRebootPending

One of my customers’ most inquiries was how to get the user machines to restart regularly.

First, we need to check whether the machine really needs restarts. If the machine wants to restart, we can produce various scenarios.
If the machine wants to restart, we can send the machine restart command.

Restart-Computer -ComputerName "ComputerName" -Force

Or it shows a warning to the user and the importance of restarting the machine can be explained. Such an interface can be improved either by HTML or again with PowerShell, allowing the user to confront it.

PowerShell ile makinenin Restart için bekleyip beklemediği nasıl bulunur?

Bir çok sistem yöneticisinin en büyük sorunlarından birisi de ağ üzerindeki makinelerin restart yapmasıdır. Peki bu bilgiye nasıl ulaşacağız ve bu bilgi bizim ne işimize yarayabilir?
Makinenin restart için beklediğini aşağıdaki PowerShell komutu ile basit bir şekilde öğrenebilirsiniz.

Continue reading “PowerShell ile makinenin Restart için bekleyip beklemediği nasıl bulunur?”

If the folder exist, appy the .reg file

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. Continue reading “If the folder exist, appy the .reg file”

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.

Continue reading “Access useful information from the SCCM’s DB #1”

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.

 

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.

Continue reading “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.”