The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,835 other subscribers

Easiest way to grant/query “Log on as a service” to a Windows user from the command-line? (my question on Super User)

Posted by jpluimers on 2014/04/28

I want to script an install where a service needs to be run as a user. I want to be able to specify the user.

Creating the user is easy through the [Wayback/Archive] NET USER /ADD command.

Specifying the user for the service can also be done: the [Wayback/ArchiveSC CONFIG command [Wayback/Archiveallows this (thanks [Wayback/Archive] wmz and [Wayback/Archive] ofiris).

Now the missing link: granting the user the [Wayback/Archive] “Log on as a service” privilege as a [Wayback/Archivelogon right (SeServiceLogonRight). Is there a command for this? Or a simple script for PowerShell?

(I know only Local Service can do this out of the box, and [Wayback/Archiveno other accounts by default are, but I want to have control over the account and what other privileges that account has).

Edit: solved. Thanks [Wayback/Archive] Mathias R. Jessen.

Here is the solution, including a few comments.

The easiest way to do this from a command line is definitely using NTRights.exe from the Windows Server 2003 Resource Toolkit.

ntrights +r SeServiceLogonRight -u jeroen -m \%COMPUTERNAME%

I changed the command-line a bit:

ntrights +r SeServiceLogonRight -u %USERNAME% -m \%COMPUTERNAME%

Note that

whoami /all

doesn’t show any change (not even after a reboot, it does not matter if you run it with or without UAC token).

secpol.msc

does show the change however, and does not require UAC (follow the tree to “Security Settings -> Local Policies -> User Rights Management -> Log on as a service” to see the users having the permission).

–jeroen

via: [Wayback/Archive] Easiest way to grant “Log on as a service” to a Windows user from the command-line? – Super User.

PS: Later I found out it is way easier to query the right:

accesschk.exe /accepteula -q -a SeServiceLogonRight

It will list the users having that right, for instance:

        IIS APPPOOLClassic .NET AppPool
        NT SERVICEALL SERVICES
        VCS-CIContinuaCI

There are similar rights one might want to query:

SeBatchLogonRight
SeDenyBatchLogonRight
SeInteractiveLogonRight
SeDenyInteractiveLogonRight
SeServiceLogonRight
SeDenyServiceLogonRight
SeNetworkLogonRight
SeDenyNetworkLogonRight

Thanks [Wayback/Archivetwasbrillig for explaining that at as answer to [Wayback/Archivepowershell – How to view user privileges using windows cmd? – Stack Overflow

Posted in Batch-Files, CommandLine, Development, Power User, PowerShell, Scripting, Software Development, Windows, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Vista | Leave a Comment »

Building URLs to Old WordPress.com Stats (from a date in the past; via: Planet Botch)

Posted by jpluimers on 2014/04/28

Every once in a while you want to browse back to WordPress visitor stats from a while ago.

Well, you can hand-build your URLs like this:

Stats at the end of last year for the default WordPress.com blog:

The Old WordPress.com Stats – How to Access Them | Planet Botch post explains how to do this for non-default blogs as well.

–jeroen

via: Old WordPress.com Stats – How to Access Them | Planet Botch.

Posted in Power User, SocialMedia, WordPress | Leave a Comment »

C# and VB are open sourced | Fabulous Adventures In Coding

Posted by jpluimers on 2014/04/27

Reminder to self:

  1. Watch the relevant Channel 9 videos.
  2. Sync the Roslyn repository regularly.

–jeroen

via: C# and VB are open sourced | Fabulous Adventures In Coding.

Posted in .NET, C#, C# 6 (Roslyn), Development, Software Development | Leave a Comment »

On my buying list: The WOZPAK Special Edition (1978 Apple I/II materials digitally enhanced)

Posted by jpluimers on 2014/04/27

At USD 50, this seems like a bargain for Apple I / Apple II lovers.

From the The WOZPAK Special Edition – Overview page:

In 1978, The WOZPAK was a 300 page technical manual produced by Apple Pugetsound Program Library Exchange.  The poor resolution of copy machines and fax machines of the era made The WOZPAK an illegible and challenging to use collection of handwritten and typed notes.  This collection as a whole was provided to the A.P.P.L.E. by Apple Computer, Inc. co-founder Steve Wozniak and then company president Mike Scott.  

Thanks to the encouragement of a number of computer industry legends, and the efforts of Apple historians, Brian Wiser and Bill Martens, we now have a completely refurbished and dramatically enhanced version of The WOZPAK.  The WOZPAK Special Edition comes complete with the original materials from The WOZPAK and The WOZPAK II as well as some new materials provided by Apple legends from their personal libraries.

–jeroen

via: The WOZPAK Special Edition – Overview.

Posted in //e, 6502, Apple, Apple Pascal, Apple ][, Assembly Language, Development, History, Pascal, Power User, Software Development | Leave a Comment »

How Do Young Go-Getters Get With Old Git? (via: Dr. Dobb’s – Google+)

Posted by jpluimers on 2014/04/25

Interesting:

How Do Young Go-Getters Get With Old Git?

fournova launches Git learning platform — from command-line interface to GUI

–jeroen

via: Dr. Dobb’s – Google+ – How Do Young Go-Getters Get With Old Git?….

Posted in Development, DVCS - Distributed Version Control, git, Source Code Management | Leave a Comment »

Windows 8.1 on VMware ESXi 5.1: Minimize/Maximize/Close buttons are invisible but functional

Posted by jpluimers on 2014/04/25

(Another one in the missed schedule list: this post was scheduled for this morning 06:00)

When you run a Windows 8.1 guest on VMware ESXi 5.1 with the VMware tools that belong to ESXi 5.1, the Minimize/Maximize/Close buttons are invisible but functional.

It doesn’t matter how you access that VM:

  • Through an RDP session (from either the MS RDP client on Mac OS X or MSTSC on a Windows machine).
  • Through a Console Window from vSphere Client connected to the ESXi host (if that client does not run on Windows XP).
  • Through a Console Window from VMware Workstation connected to the ESXi host.

It is good to know that this is just a visual artefact, the Minimize/Maximixe/Close buttons still work:

I was having the same exact problem with my Windows 8.1 VM.  If you click the location where the buttons should be, it still works like they are there.

But he uses a solution that is not really the kind I like:

I opened Device Manager on the VM and then uninstalled the VMware Display Adaptor, including the software for the driver.  After doing that, I scanned for hardware changes and it reinstalled the display adaptor using a windows driver.

The youngest VMware Tools version it fails with on my system is this one: 9.6.1.1378637.

Uninstalling the driver from the device manager indeed solves the issue, but:   Read the rest of this entry »

Posted in ESXi4, ESXi5, ESXi5.1, ESXi5.5, Power User, VMware, VMware ESXi, VMware Workstation | Leave a Comment »

Build interactive books using Git and Markdown: GitBook (via: Ilya Grigorik – Google+)

Posted by jpluimers on 2014/04/24

GitBook is definitely on my list of things to try.

See the experiments from Ilya Grigorik – Google+ – Build interactive books using Git and Markdown:….

–jeroen

Posted in LifeHacker, Power User | Leave a Comment »

Apache2 on openSUSE 12.x: some notes

Posted by jpluimers on 2014/04/24

Getting Apache configured on a *nix installation like openSUSE installation is always a bit of a challenge.

A few things I observed: Read the rest of this entry »

Posted in *nix, Apache2, Linux, openSuSE, Power User, SuSE Linux | 2 Comments »

IdeOne is a lot faster and more recent than “Compile and Execute C# Sharp online”

Posted by jpluimers on 2014/04/23

I just bumped into Compile and Execute C# Sharp online.

As of writing, it uses Mono 2.10.2.0 which is quite old, and it is dead slow: it takes more than a minute to compile and execute a simple console application.

The reason is that this is a one man project.

IdeOne is much faster, for instance it took a few seconds to compile and run this simple C# program.

–jeroen

Posted in .NET, C#, Development, Mono, Software Development | Leave a Comment »

Project Naptha

Posted by jpluimers on 2014/04/23

Interesting, not only because it is available as Chrome Extension:

Project Naptha automatically applies state-of-the-art computer vision algorithms on every image you see while browsing the web. The result is a seamless and intuitive experience, where you can highlight as well as copy and paste and even edit and translate the text formerly trapped within an image.

–jeroen

via: Project Naptha.

Posted in OCR, Power User | Leave a Comment »