Giter Club home page Giter Club logo

Comments (8)

etreater avatar etreater commented on May 27, 2024

I'm in a similar boat Anaylor. Couldn't get it to do anything, despite it showing as successful in Intune. I finally toggled it over to run as SYSTEM instead of the Logged in USER. This created the Schedule task, but I can't get that to run. It looks like it's calling a VBS file. When I tried to run the VBS File manually, It comes back with error at line 7 character 2. I don't know what I'm doing wrong, but here the VB code.

Dim shell,fso,file

Set shell=CreateObject("WScript.Shell")
Set fso=CreateObject("Scripting.FileSystemObject")

strPath=WScript.Arguments.Item(0)

If fso.FileExists(strPath) Then
	set file=fso.GetFile(strPath)
	strCMD="powershell -nologo -executionpolicy ByPass -command " & Chr(34) & "&{" &_ 
	file.ShortPath & "}" & Chr(34) 
	shell.Run strCMD,0
End If

from intunedrivemapping.

nicolonsky avatar nicolonsky commented on May 27, 2024

Hi guys @anaylor130683 @etreater "Script not working" is not a really helpful description for an issue.

@anaylor130683 PowerShell execution policy does not interferer when the script is executed via Intune or scheduled task as both mechanism bypass the execution policy

@etreater the vbscript is only a wrapper to suppress the PowerShell window from appearing. It takes the path of the PowerShell script as command line argument

from intunedrivemapping.

etreater avatar etreater commented on May 27, 2024

from intunedrivemapping.

nicolonsky avatar nicolonsky commented on May 27, 2024

@etreater I published a new version of the script and populated the project wiki with some troubleshooting info and details.

Your problem is probably related to the issue that your machines don't have the $env:USERDNSDOMAIN environment variable - you find the required adjustments in the wiki. Just update the $searchRoot variable with your active directory domain name e.g. "intra.contoso.com".

from intunedrivemapping.

etreater avatar etreater commented on May 27, 2024

from intunedrivemapping.

nicolonsky avatar nicolonsky commented on May 27, 2024

Then you need to investigate the ‘Get-ADGroupMembership’ function in the script - what does it return in your case? It usually returns all groups (sam account name format) the user is a member of. You also need to specify your group filters with sam account format without any domain prefix. @etreater

from intunedrivemapping.

etreater avatar etreater commented on May 27, 2024

from intunedrivemapping.

nicolonsky avatar nicolonsky commented on May 27, 2024

@etreater glad that it resolved your issue. I‘ve also added the sAMAccountName stuff without the domain prefix to the wiki.
Cheers, nicola

from intunedrivemapping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.