@Arrowhead-IT Well it was worth a shot but it didn’t do the trick, maybe restarting would work, I’m backing up before I try that though.
Posts
-
RE: Can't Edit Exisiting Snapins or Create New onesposted in Bug Reports
-
RE: Active directory Join issueposted in Windows Problems
@anthonyglamis No, you don’t need to create a new image for a new revision. It’s only if you reinstalled fog completely, regenerating the ca certs.
-
RE: Can't Edit Exisiting Snapins or Create New onesposted in Bug Reports
I found a script to restore permissions here
http://serverfault.com/questions/221447/how-to-repair-restore-ubuntu-10-04-after-sudo-chmod-777#!/bin/bash # Restores file permissions for all files on a debian system for which .deb # packages exist. # # Author: Larry Kagan <me at larrykagan dot com> # Since 2007-02-20 ARCHIVE_DIR=/var/cache/apt/archives/ PACKAGES=`ls $ARCHIVE_DIR` cd / function changePerms() { CHOWN="/bin/chown" CHMOD="/bin/chmod" PERMS=`echo $1 | sed -e 's/--x/1/g' -e 's/-w-/2/g' -e 's/-wx/3/g' -e 's/r--/4/g' -e 's/r-x/5/g' -e 's/rw-/6/g' -e 's/rwx/7/g' -e 's/---/0/g'` PERMS=`echo ${PERMS:1}` OWN=`echo $2 | /usr/bin/tr '/' '.'` PATHNAME=$3 PATHNAME=`echo ${PATHNAME:1}` # echo -e "CHMOD: $CHMOD $PERMS $PATHNAME" # result=`$CHOWN $OWN $PATHNAME` # if [ $? -ne 0 ]; then # echo -e $result # exit 123; # fi echo -e "CHOWN: $CHMOD $PERMS $PATHNAME" result=`$CHMOD $PERMS $PATHNAME` if [ $? -ne 0 ]; then echo -e $result fi } for PACKAGE in $PACKAGES; do if [ -d $PACKAGE ]; then continue; fi echo -e "Getting information for $PACKAGE\n" FILES=`/usr/bin/dpkg -c "${ARCHIVE_DIR}${PACKAGE}"` for FILE in "$FILES"; do #FILE_DETAILS=`echo "$FILE" | awk '{print $1"\t"$2"\t"$6}'` echo "$FILE" | awk '{print $1"\t"$2"\t"$6}' | while read line; do changePerms $line done #changePerms $FILE_DETAILS done done``` It's running right now, hopefully that does the trick. -
RE: Can't Edit Exisiting Snapins or Create New onesposted in Bug Reports
@Wayne-Workman
[Mon Jan 25 12:30:49.536526 2016] [:error] [pid 24884] [client 192.168.100.108:61538] PHP Fatal error: Uncaught exception ‘Exception’ with message 'FOGFTP: Failed to connect. Host: 192.168.100.100, Error: Undefined variable: whereA$I couldn’t copy the whole error message from the terminal with ease, it appears to be ftp related. So I tried to ftp in only for it to not work on port 22 and on port 21 I get this message
OOPS: vsftpd: refusing to run with writable root inside chroot()So this is a me accidentally running
chmod -R 775 /instead ofchmod -R 775 ./and not cancelling it fast enough problem, not a fog problem at all. -
Adding Custom Printer Configurationposted in Feature Request
Add printer configuration to printer management. i.e. a sharp copier that requires you to manually click auto configuration for the printer to update it’s settings to match the printer.
I already have this scripted and imagine it would be pretty easy to add to the existing printer management. I would gladly add and test the code myself if someone could point me in the right direction.So lets say you have added a printer and configured it to all the correct settings, like how many input trays, types of output trays, maybe it requires putting in a security pin or it has a punch module. And it looks like this for example.

Then to save those configuration settings you simply need to run this command in a command prompt
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n"Printer Name" /a Path\ConfigFile.dat m f g p
and then to configure the printer once it’s been added with the saved config
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n"Printer Name" /a Path\ConfigFile.dat m f g pI imagine that the way the print manager works is similar to the script I use to add a printer with the similar command line inputs.
For example, I can use the following script (manually adding in the parameters in the call of installPrinter in the main function) to install a printer. I could probably easily change it to take arguments into the execution like snapin arguments taken from the printer information. Which I imagine is somewhat how the add a printer works.@ECHO off call :main exit :main REM Function to call other functions and run the installation process call :setVars call :funcHead "Welcome to the Printer installer!" REM inputs: 1 - Printer Port Name, 2 - printer ip or hostname 3- driverPath 4 - printer name 5 - printer model 6 - config file 7 - raw or lpr call :installPrinter EXIT /B :setVars REM function for setting script variables, typically for directories call :funcHead "Setting script variables" set share="\\networkShare\Printers\Drivers" net use "%share%" echo. done! EXIT /B :installPrinter REM Function to add a new Printer REM inputs: 1 - Printer Port Name, 2 - printer ip or hostname 3- driverPath 4 - printer name 5 - printer model 6 - config file 7 - raw or lpr call :funcHead "Installing Printer %~4" call :printerPort %~1 %~2 %~7 call :printerDriver "%~3" call :addPrinter "%~4" "%~5" %~1 call :configPrinter "%~6" "%~4" echo. done installing printer %~4! EXIT /B :printerPort REM function for adding a printer port REM var inputs 1 - port name 2 -hostname or ip address 3 -port type (raw or lpr) call :dots echo. Creating the printer port... IF %~3==lpr ( Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r %~1 -h %~2 -o lpr -q lp -n 515 ) ELSE ( REM raw Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r %~1 -h %~2 -o raw -n 9100 ) echo. done! call :dots EXIT /B :printerDriver REM function to add the driver input 1=full driver path call :dots echo. Adding printer driver... PNPUTIL -i -a "%~1" echo. done! call :dots EXIT /B :addPrinter REM add the printer to the created port REM 1 - printer name 2 - printer model associated with driver 3 - port name call :dots echo. adding printer to network port... Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnmngr.vbs -a -p "%~1" -m "%~2" -r %~3 echo. done! call :dots :configPrinter REM add any special printer configurations REM 1 - config file path 2 - printer name call :dots echo. Configuring Printer... REM To create a config file for a printer, use the following syntax REM RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /nPrinterName /a ConfigFilePath.dat m f g p RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n"%~2" /a %~1 m f g p echo. done! call :dots EXIT /B :dots REM just echoing dots in a Function instead of copy pasting them so that it's consistent echo ...................................................................... EXIT /B :funcHead REM A simple function for displaying a consistent header at the start of functions call :dots echo. %~1 call :dots EXIT /BI would rather use the fog print management with the added ability to import printer config files, as it is the only thing it doesn’t do that my scripting method does. Granted I could just set this idea up as a snapin, but I don’t have the remove printer functionality in my script as is. So What can I do to add this functionality in.
-
Can't Edit Exisiting Snapins or Create New onesposted in Bug Reports
On the latest revision 6096, as well as the one this morning (6094 I believe, I noticed the problem and updated before posting)
When I try to edit a snapin or create a new one it goes to a blank white page in firefox.
In chrome it gives a 500 error saying the system might be down for maintenance. -
RE: Database Schema Installer / Updaterposted in FOG Problems
@Tom
Trunk isn’t beta in the traditional sense. I would strongly recommend upgrading to it. If there are problems you post it on the forum and often the issue is fixed in a manner of hours. -
RE: FOG With BASHposted in General
@jc35 So I think you can do this
I would follow the help @Wayne-Workman gave you on this post
https://forums.fogproject.org/topic/6454/wipe-and-restoreUsing the information of what the database tables need to say you could write a bash or python script to edit the mysql database of fog.
The next question is whether or not you need help with that part too.
The basics steps you would need to do- make a remote mysql user with access to the fog database on the fog server.
- Compose and test some mysql commands remotely based on the tables you need to edit and make sure it works
- Take those commands and put them into a script. In bash it is possible to send a single command to mysql, I don’t remember the parameter of the top of my head though, I would have to go find a script where I did that if need be.
Hopefully that helps you get started.
-
RE: WIndows 10 Capture/Deploy Woesposted in FOG Problems
So I’m noticing a couple things.
- The first boot error relates to efi - perhaps you have an efi partition separate from the install and would need to do multiple partition image
- At the same time there are .mbr files and also gpt messages. GPT is typically associated with efi style images and mbr with bios/legacy style images.
So are you using uefi on the image you are uploading from?
Are you uploading from legacy and then downloading to a computer set to uefi mode?
Personally I find mbr and bios/legacy mode to work just fine and to be just much simpler. So if it’s not too much effort you could redo the image making sure that your computer is booting to legacy/bios mode. In some bios’s you have to disable secure boot before it lets you enable the legacy boot mode. GPT and uefi do work with fog, don’t get me wrong, but I just find gpt easier. Also, a side note, to ensure you make only one partition when you install windows (this works on at least windows 7 and up) when you have the install disc in and you’re at the partition selection, hit shift+f10 to bring up a command prompt. Then run the following commands to clear out all existing partitions and make only one new one. As far as I have found this only works with mbr style partitions. There is probably a way to do it for gpt, I just haven’t found it yet, which is another reason I stick with mbr.diskpart list disk (It will list the disks with details, most likely you'll want disk 0, but list and check to be sure) select disk 0 clean create partition primary exit exitThen hit refresh on the windows gui partition editor and select the newly created partition
If you put a lot of work into this image and don’t want to start over on it, no worries, we can still try some other stuff.
Go into fog and queue a download of the image ticking the “schedule as a debug task” box.
Now you will be able to step through the image process and run some other commands on the computer you are imagingI would try running fixparts on /dev/sda in a debug session. This may fix any mbr/gpt confusion within the drive or image your using and that alone could make it work.
If that doesn’t do the trick. Then we’ll come back to the drawing board.So, that was a lot of information, let me summarize a little.
- Is your image source a gpt/efi setup or a mbr/bios setup?
- Do you want it to be resizable or do you not care because they’re all the same size hard drive?
- Have you tried running fixparts (I would recommend trying this before uploading the source image as well as before download)
- Consider making a new mbr style image in bios/legacy mode using the instructions I gave above, as I know it works for windows 10
-
RE: MSI Silent installposted in General
@Arrowhead-IT I figure that I should report that in my recent testing with the latest client I have not had any problems with the client being installed as part of the image. It works as it should. I intend to use the script I posted here as a gpo script to add all the active directory computers on my network to fog in one quick click.
-
RE: Cortana/Windows Search breaks in default profileposted in Windows Problems
So one caveat to my method with using devcon from the windows wdk (https://msdn.microsoft.com/en-us/windows/hardware/dn913721.aspx)
is that when you remove all the devices it removes and doesn’t reinstall on restart a couple system devices that are required to make remote desktop work.
So in other words you can’t rdp/windows remote desktop into an imaged computer. I had found this rather annoying and finally figured out exactly which devices are required and scripted how to fix it. yay!This is also helpful to anyone that perhaps is having trouble with remote desktop when it is otherwise configured correctly.
So the devices that you could install manually as legacy devices are…
- NDIS Virtual Network Adapter Enumerator
- UMBus Root Bus Enumerator (adds UMBus Enumerators on restart that are also needed)
- Remote Desktop Device Redirector Bus
Luckily the inf files for all of these are still in the driverstore. And the devcon.exe tool can be used to install them quickly from the command line. 0_1453504913836_devcon.exe - 64 bit version from wdk 8.1 - put this in your C:\Windows\System32 for the following script to work. You can also download and install the wdk from the above link and find it in C:\Program Files (x86)\Windows Kits\10 somewhere, a tools folder of some sort as I recall. I tested it with the 8.1 version but just discovered there is a windows 10 version as I was writing this.
Anywho, scripty script
@ECHO off REM Script for fixing remote desktop after uninstalling all devices call :main :main call :funcHead "Welcome to the remote desktop fix!" call :setVars call :addDriver "NDIS Virtual Network Adapter Enumerator" "%drivers%\ndisvirtualbus.inf_amd64_c420021ea374b6f3\ndisvirtualbus.inf" ROOT\NdisVirtualBus call :addDriver "UMBus Root Bus Enumerator" "%drivers%\umbus.inf_amd64_b5911c04e2dae8d2\umbus.inf" root\umbus.inf call :addDriverAndRestart "Remote Desktop Device Redirector Bus" "%drivers%\rdpbus.inf_amd64_e1a9f2699d349149\rdpbus.inf" ROOT\RDPBUS EXIT /B :setVars set drivers=C:\Windows\System32\DriverStore\FileRepository EXIT /B :addDriver echo. installing %~1... Devcon install %~2 %~3 echo. done! EXIT /B :addDriverAndRestart echo. installing %~1 and restarting computer... Devcon -r install %~2 %~3 echo. done! REM just in case -r doesn't reboot... Devcon reboot & exit EXIT /B :dots REM just echoing dots in a Function instead of copy pasting them so that it's consistent echo ...................................................................... EXIT /B :funcHead REM A simple function for displaying a consistent header at the start of functions call :dots echo. %~1 call :dots EXIT /Brun that as a batch script, it will restart your computer and it will fix remote desktop if you break it by manually uninstalling devices
I had been having trouble with this problem for months and just fixed it and figured it related enough to everything else here so I shared it
-
RE: Active directory Join issueposted in Windows Problems
@anthonyglamis This sounds like a client issue, any thoughts @Jbob
-
RE: HP Z640 - NVME PCI-E Driveposted in Hardware Compatibility
@Tom-Elliott Yes, I just did. I marked it as unsolved when it broke again.
-
RE: Active directory Join issueposted in Windows Problems
@anthonyglamis Nope. The installer will auto download the latest client to your server and you don’t need to maually update your hosts with the new client. I think it’s supposed to update itself even, if I remember right
-
RE: Cortana/Windows Search breaks in default profileposted in Windows Problems
@MRCUR Well I think it is possible to edit it directly, but it is not easy.
Let’s say you run my script and have a working default profile and you saved the folder somewhere.
Now let’s copy the whole profile folder to the local computer, in the C:\ root for example(just to be safe not editing the original right away)
Now open up regedit.exe as an administrator and highlight ‘HKEY_USERS’
File → Load Hive
Open up
“C:\Default\NTUSER.DAT”
name the hive test, or something like that.You can now edit the default profile registry .dat settings to your heart’s content. Problem is, it’s the registry…
So the second half of task bar pins is in that hive under
HKEY_USERS\test\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband
But that key is all binary and Dwords.
Granted, you could just customize some pins on any user and export that key from
HKEY_USERS\userSID\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband
And then import or copy paste the values into the hive you’re editing and that would work.
Then just highlight the test hive and do file→unload hive and all the settings should be saved in the .dat file.I saw some vbs scripts in various forums that claimed to automate the pinning but I didn’t try any of them. But I’ll post some links in case they help you do it the way you want to.
Here’s where I came up with most of this
http://smallbusiness.chron.com/modify-ntuserdat-56096.html - editing ntuser.dat
https://social.technet.microsoft.com/Forums/windows/en-US/73eb1c0a-fc78-4ae7-ba6d-356d9a9a5328/solved-how-to-pin-to-start-menutask-bar-for-default-user?forum=w7itproinstall - possible script solution
http://blogs.technet.com/b/deploymentguys/archive/2008/06/06/useful-script-number-5-adjusting-the-default-user-registry-hive.aspx - editing ntuser.dat some more
http://blogs.technet.com/b/deploymentguys/archive/2009/04/08/pin-items-to-the-start-menu-or-windows-7-taskbar-via-script.aspx - other script possibilityHope that helps in some way. Sorry that I didn’t find an easy answer for you.
-
RE: HP Z640 - NVME PCI-E Driveposted in Hardware Compatibility
@Arrowhead-IT said:
I’m about to test upload on the updated version.
Great success, forgot to post that this worked.
All is working as of 6050
-
RE: HP Z640 - NVME PCI-E Driveposted in Hardware Compatibility
@Wayne-Workman Oh trust me I value my sleep. I just had to move my desk at the odd request of upper management (I won’t get into that…) But the new placing of my desk makes it so the lights in the room and the light from the monitor hits my eyes just right. And by just right, I mean just right for excruciating melting eye pain. And this made it more difficult to sleep and made me want to close my eyes all day. I fixed the lighting issue though. But point is, trust me I know, I don’t sacrifice sleep, I have had to have sleep studies and fun stuff like that. This situation was just forced upon me.
Thanks for the good advice though. I always enjoy a good sleep success story.
-
RE: FOG With BASHposted in General
@jc35 Just to be sure I understand what you’re trying to do,
You have an inventory system in glpi.
You want to make it so if you hit delete on a computer in your inventory rabbit mq sends a message to fog to wipe the machine and put a default image (like a retail windows or basic linux that the computer can be sold with I’m guessing) on the deleted computer.So you want to click one button to delete the computer from your inventory and it automatically prepares itself to be safely disposed/surplussed/sold or what have you.
Do I understand correctly?
-
RE: Cortana/Windows Search breaks in default profileposted in Windows Problems
@MRCUR I see what you’re saying. It would be less work to not have to manually pin some icons to the taskbar and then run the script.
Granted I have my default base image with my default profile on a esxi vm, so for me it is pretty easy to do. I suppose it could be possible to edit the ntuser.dat file manually to add in shortcuts. I’ll look into that, because it would certainly be easier. -
RE: HP Z640 - NVME PCI-E Driveposted in Hardware Compatibility
@Arrowhead-IT Sorry for the delay, my btsync stopped working, still not working and then I broke my local git repo…like 30 different times because I’m dumb when I’m sleepy. Dumb like trying to reset my git repo to the master branch instead of the dev-branch and wondering why it was installing a version in the 3000’s. Fun fact, if you can’t git pull, try
git fetch --all && git reset --hard origin/dev-branchBut anyway back to working correctly and on 6050Resizable download is working again, hooray!
I did try running fog.upload from the download debug session. But I then redid it in an upload debug session and the same error happened. I’m about to test upload on the updated version.